You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Eric W. <war...@us...> - 2001-09-29 23:06:32
|
Update of /cvsroot/gaim/gaim/src/protocols In directory usw-pr-cvs1:/tmp/cvs-serv5211/src/protocols Modified Files: Makefile.am Log Message: Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops. Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion. Also fixing an IRC bug. Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps Index: Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 2001/07/31 01:00:38 1.1 +++ Makefile.am 2001/09/29 23:06:30 1.2 @@ -1,6 +1,6 @@ if PRPLS -SUBDIRS = icq irc jabber msn napster oscar toc yahoo zephyr +SUBDIRS = gg icq irc jabber msn napster oscar toc yahoo zephyr else |
From: Eric W. <war...@us...> - 2001-09-29 23:06:32
|
Update of /cvsroot/gaim/gaim/po In directory usw-pr-cvs1:/tmp/cvs-serv5211/po Modified Files: POTFILES.in Log Message: Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops. Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion. Also fixing an IRC bug. Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps Index: POTFILES.in =================================================================== RCS file: /cvsroot/gaim/gaim/po/POTFILES.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- POTFILES.in 2001/08/30 21:24:13 1.11 +++ POTFILES.in 2001/09/29 23:06:30 1.12 @@ -1,3 +1,4 @@ +src/protocols/gg/gg.c src/protocols/icq/gaim_icq.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c |
From: Eric W. <war...@us...> - 2001-09-29 23:06:32
|
Update of /cvsroot/gaim/gaim/pixmaps In directory usw-pr-cvs1:/tmp/cvs-serv5211/pixmaps Modified Files: Makefile.am Added Files: gg_suncloud.xpm gg_sunred.xpm gg_sunwhitered.xpm gg_sunyellow.xpm Log Message: Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops. Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion. Also fixing an IRC bug. Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps --- NEW FILE: gg_suncloud.xpm --- /* XPM */ static char * gg_suncloud_xpm[] = { "18 18 7 1", " c None", ". c #FF0000", "+ c #7F7F7F", "@ c #FFFF00", "# c #000000", "$ c #00007F", "% c #00FFFF", " ", " . ", " .+ ", " . .+ . ", " . ..@.. .+ ", " .@@@@@.+ ", " .@@#@#@@.+ ", " .@@@@@@@.+ ", " ...@$@@@@@@@... ", " $$%$@@@#@$$$++ ", " $%%%%$##@$%%%$ ", " $%%%%%%$$$%%%%$ ", " $%%%%%%%%%%%%%%$ ", " $%%%%%%%%%%%%%$ ", " $%%%%%%%%%%%%$ ", " $%%%$$$%%%$$$ ", " $$$ $$$ ", " "}; --- NEW FILE: gg_sunred.xpm --- /* XPM */ static char * gg_sunred_xpm[] = { "19 18 4 1", " c None", ". c #FF0000", "+ c #7F7F7F", "@ c #000000", " ", " . ", " .+ ", " . .+ . ", " . ..... .+ ", " .......+ ", " ...@.@...+ ", " .........+ ", " ............... ", " ..@...@..++++ ", " ...@@@...+ ", " .......+ ", " .+..... .+ ", " .+ .++ .+ ", " + .+ ", " .+ ", " + ", " "}; --- NEW FILE: gg_sunwhitered.xpm --- /* XPM */ static char * gg_sunwhitered_xpm[] = { "19 18 6 1", " c None", ". c #7F0000", "+ c #FF0000", "@ c #7F7F7F", "# c #FFFFFF", "$ c #000000", " ", " . ", " +@ ", " + .@ + ", " . .+#+. .@ ", " +#####+@ ", " .##$#$##.@ ", " +#######+@ ", " .+.#########.+. ", " +#$###$#+@@@@ ", " .##$$$##.@ ", " +#####+@ ", " .@.+#+. .@ ", " +@ .@@ +@ ", " @ +@ ", " .@ ", " @ ", " "}; --- NEW FILE: gg_sunyellow.xpm --- /* XPM */ static char * gg_sunyellow_xpm[] = { "18 18 5 1", " c None", ". c #FF0000", "+ c #7F7F7F", "@ c #FFFF00", "# c #000000", " ", " . ", " .+ ", " . .+ . ", " . ..@.. .+ ", " .@@@@@.+ ", " .@@#@#@@.+ ", " .@@@@@@@.+ ", " ...@@@@@@@@@... ", " .@#@@@#@.++++ ", " .@@###@@.+ ", " .@@@@@.+ ", " .+..@.. .+ ", " .+ .++ .+ ", " + .+ ", " .+ ", " + ", " "}; Index: Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/pixmaps/Makefile.am,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- Makefile.am 2001/09/20 03:16:43 1.55 +++ Makefile.am 2001/09/29 23:06:30 1.56 @@ -34,6 +34,10 @@ fontface2.xpm \ free_icon.xpm \ gaim.xpm \ + gg_suncloud.xpm \ + gg_sunred.xpm \ + gg_sunwhitered.xpm \ + gg_sunyellow.xpm \ gnome_add.xpm \ gnome_preferences.xpm \ gnome_remove.xpm \ |
From: Eric W. <war...@us...> - 2001-09-29 23:06:32
|
Update of /cvsroot/gaim/gaim/doc In directory usw-pr-cvs1:/tmp/cvs-serv5211/doc Modified Files: CREDITS Log Message: Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops. Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion. Also fixing an IRC bug. Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps Index: CREDITS =================================================================== RCS file: /cvsroot/gaim/gaim/doc/CREDITS,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- CREDITS 2001/08/14 21:50:38 1.29 +++ CREDITS 2001/09/29 23:06:30 1.30 @@ -36,6 +36,8 @@ A healthy amount of patches for the Jabber plugin Neil Sanchala Wrote most of the Zephyr plugin +Arkadiusz Miskiewicz + Wrote the Gadu-Gadu plugin David Prater <IM: dRaven43> dr...@tc... Log and Colour Button Images |
From: Eric W. <war...@us...> - 2001-09-29 23:06:32
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv5211 Modified Files: ChangeLog acconfig.h configure.ac Log Message: Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops. Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion. Also fixing an IRC bug. Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.305 retrieving revision 1.306 diff -u -d -r1.305 -r1.306 --- ChangeLog 2001/09/28 12:15:54 1.305 +++ ChangeLog 2001/09/29 23:06:29 1.306 @@ -11,6 +11,7 @@ * Nick Highlighting in chat * Tab-completion for nicks in chat (thanks to Sean Egan) * Large internal reworkings + * New Protocol: Gadu-Gadu, written by Arkadiusz Miskiewicz version 0.44 (09/20/2001): * More sane scaling of buddy icons (intelligently scale to Index: acconfig.h =================================================================== RCS file: /cvsroot/gaim/gaim/acconfig.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- acconfig.h 2001/08/27 22:39:17 1.11 +++ acconfig.h 2001/09/29 23:06:29 1.12 @@ -17,7 +17,6 @@ #undef ARTSC_SOUND #undef _REENTRANT #undef NEED_GNOMESUPPORT_H -#undef NEED_SOCKLEN_T #undef ZEPHYR_INT32 #undef ZEPHYR_USES_KERBEROS #ifndef STATIC_PROTO_INIT Index: configure.ac =================================================================== RCS file: /cvsroot/gaim/gaim/configure.ac,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- configure.ac 2001/09/20 21:01:49 1.14 +++ configure.ac 2001/09/29 23:06:29 1.15 @@ -32,8 +32,6 @@ AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_CHECK_FUNCS(socket strdup strstr atexit getaddrinfo) -AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/socket.h>], [socklen_t slen;],,[AC_DEFINE(NEED_SOCKLEN_T)]) dnl Checks for getopt in standard library AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) @@ -48,7 +46,7 @@ AC_ARG_ENABLE(prpls, [ --disable-prpls don't build dynamic protocol plugins],,enable_prpls=yes) AC_ARG_WITH(static-prpls, [ --with-static-prpls link in certain protocols statically],[STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`],STATIC_PRPLS="oscar toc") if test "x$STATIC_PRPLS" = "xall" ; then - STATIC_PRPLS="icq irc jabber msn napster oscar toc yahoo zephyr" + STATIC_PRPLS="gg icq irc jabber msn napster oscar toc yahoo zephyr" fi AC_SUBST(STATIC_PRPLS) STATIC_LINK_LIBS= @@ -59,6 +57,7 @@ extern_init="$extern_init extern void ${i}_init(struct prpl *);" load_proto="$load_proto load_protocol(${i}_init, sizeof(struct prpl));" case $i in + gg) static_gg=yes ;; icq) static_icq=yes ;; irc) static_irc=yes ;; jabber) static_jabber=yes ;; @@ -71,6 +70,7 @@ *) echo "Invalid static protocol $i!!" ; exit ;; esac done +AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes") AM_CONDITIONAL(STATIC_ICQ, test "x$static_icq" = "xyes") AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes") AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes") @@ -358,6 +358,7 @@ sounds/Makefile src/Makefile src/protocols/Makefile + src/protocols/gg/Makefile src/protocols/icq/Makefile src/protocols/irc/Makefile src/protocols/jabber/Makefile |
From: Eric W. <war...@us...> - 2001-09-29 08:40:52
|
Update of /cvsroot/gaim/gaim/src/protocols/gg In directory usw-pr-cvs1:/tmp/cvs-serv15283/gg Log Message: Directory /cvsroot/gaim/gaim/src/protocols/gg added to the repository |
From: Eric W. <war...@us...> - 2001-09-29 02:08:11
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv361 Modified Files: socketmanager.c socketmanager.h Log Message: no socklen_t! Index: socketmanager.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/socketmanager.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- socketmanager.c 2001/07/31 01:00:38 1.1 +++ socketmanager.c 2001/09/29 02:08:00 1.2 @@ -74,7 +74,7 @@ * Creates a new socket by accepting a connection from a listening * socket. */ -int icq_SocketAccept(int listens, struct sockaddr *addr, socklen_t *addrlen) +int icq_SocketAccept(int listens, struct sockaddr *addr, int *addrlen) { int s = accept(listens, addr, addrlen); Index: socketmanager.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/socketmanager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- socketmanager.h 2001/07/31 01:00:38 1.1 +++ socketmanager.h 2001/09/29 02:08:00 1.2 @@ -32,13 +32,9 @@ #include <sys/types.h> #ifndef _WIN32 -#ifdef NEED_SOCKLEN_T -typedef unsigned int socklen_t; -#endif #include <sys/socket.h> #else #include <winsock.h> -typedef unsigned __int32 socklen_t; #endif #include "icq.h" @@ -56,7 +52,7 @@ }; int icq_SocketNew(int domain, int type, int protocol); -int icq_SocketAccept(int listens, struct sockaddr *addr, socklen_t *addrlen); +int icq_SocketAccept(int listens, struct sockaddr *addr, int *addrlen); void icq_SocketAlloc(int socket_fd); int icq_SocketDelete(int socket_fd); void icq_SocketSetHandler(int socket_fd, int type, icq_SocketHandler handler, |
From: Eric W. <war...@us...> - 2001-09-29 01:36:04
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv27947 Modified Files: buddy_chat.c Log Message: Arkadiusz Miskiewicz put in a patch for a Gadu-Gadu (www.gadu-gadu.pl) plugin. this isn't it. Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- buddy_chat.c 2001/09/29 01:16:54 1.121 +++ buddy_chat.c 2001/09/29 01:36:02 1.122 @@ -1004,7 +1004,7 @@ c = new_conversation(name); } - + set_convo_gc(c, b->gc); } void ignore_callback(GtkWidget *w, struct conversation *b) |
From: Eric W. <war...@us...> - 2001-09-29 01:16:58
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv25110 Modified Files: buddy_chat.c Log Message: that was stupid Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- buddy_chat.c 2001/09/28 23:35:43 1.120 +++ buddy_chat.c 2001/09/29 01:16:54 1.121 @@ -646,7 +646,7 @@ } g_free(who); - if (g_strcasecmp(gc->username, gc->displayname)) { + if (!g_strcasecmp(gc->username, gc->displayname)) { g_free(msg); return FALSE; } |
From: Eric W. <war...@us...> - 2001-09-29 00:18:53
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv16836 Modified Files: gaimrc.c Log Message: handle new versions better. Index: gaimrc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- gaimrc.c 2001/09/28 23:54:36 1.84 +++ gaimrc.c 2001/09/29 00:18:50 1.85 @@ -1056,12 +1056,8 @@ if ((f = fopen(buf, "r"))) { fgets(buf, sizeof(buf), f); sscanf(buf, "# .gaimrc v%d", &ver); - if ((ver <= 3) || (buf[0] != '#')) { - fclose(f); + if ((ver <= 3) || (buf[0] != '#')) set_defaults(); - save_prefs(); - return; - } while (!feof(f)) { switch (gaimrc_parse_tag(f)) { |
From: Eric W. <war...@us...> - 2001-09-28 23:54:39
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv11480 Modified Files: gaimrc.c Log Message: default Index: gaimrc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- gaimrc.c 2001/09/28 08:51:46 1.83 +++ gaimrc.c 2001/09/28 23:54:36 1.84 @@ -995,7 +995,8 @@ chat_options = OPT_CHAT_LOGON | OPT_CHAT_POPUP | - OPT_CHAT_BUTTON_XPM; + OPT_CHAT_BUTTON_XPM | + OPT_CHAT_TAB_COMPLETE; font_options = 0; |
From: Eric W. <war...@us...> - 2001-09-28 23:45:22
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv9001/src Modified Files: gtkticker.h Log Message: no // Index: gtkticker.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkticker.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gtkticker.h 2000/11/21 01:00:45 1.2 +++ gtkticker.h 2001/09/28 23:45:19 1.3 @@ -45,17 +45,17 @@ typedef struct _GtkTickerClass GtkTickerClass; typedef struct _GtkTickerChild GtkTickerChild; -// XXX children move from right to left, should be able to go other way +/* XXX children move from right to left, should be able to go other way */ struct _GtkTicker { GtkContainer container; - guint interval; // how often to scootch - guint spacing; // inter-child horizontal spacing - guint scootch; // how many pixels to move each scootch - gint timer; // timer object - guint total; // total width of widgets - guint width; // width of containing window + guint interval; /* how often to scootch */ + guint spacing; /* inter-child horizontal spacing */ + guint scootch; /* how many pixels to move each scootch */ + gint timer; /* timer object */ + guint total; /* total width of widgets */ + guint width; /* width of containing window */ gboolean dirty; GList *children; }; |
From: Eric W. <war...@us...> - 2001-09-28 23:45:22
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv9001/src/protocols/icq Modified Files: stdpackets.c Log Message: no // Index: stdpackets.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/stdpackets.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- stdpackets.c 2001/07/31 01:00:38 1.1 +++ stdpackets.c 2001/09/28 23:45:19 1.2 @@ -104,7 +104,7 @@ icq_Packet *p=icq_TCPCreateStdPacket( plink, ICQ_TCP_MESSAGE, - statusMode, //one of the icq_tcp_msg_read... constants + statusMode, /* one of the icq_tcp_msg_read... constants */ "", 0, /* status */ 0); |
From: Eric W. <war...@us...> - 2001-09-28 23:35:47
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv7340 Modified Files: buddy_chat.c conversation.c Log Message: logic error Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- buddy_chat.c 2001/09/28 12:15:54 1.119 +++ buddy_chat.c 2001/09/28 23:35:43 1.120 @@ -486,7 +486,7 @@ continue; } if (g_strncasecmp(nick + 1, entered, strlen(entered))) { - if (nick[0] != '@' && nick[1] != '+') { + if (nick[0] != '@' || nick[1] != '+') { nicks = nicks->next; continue; } Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.269 retrieving revision 1.270 diff -u -d -r1.269 -r1.270 --- conversation.c 2001/09/28 12:15:54 1.269 +++ conversation.c 2001/09/28 23:35:44 1.270 @@ -1504,7 +1504,7 @@ g_free(t2); } - if (!(flags & WFLAG_NOLOG) && ((logging_options & OPT_LOG_ALL) || find_log_info(c->name))) { + if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { char *t1, *t2; char *nm = g_malloc(256); if (c->is_chat) |
From: Eric W. <war...@us...> - 2001-09-28 12:15:57
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv4917/src Modified Files: buddy_chat.c conversation.c convo.h gaim.h prefs.c Log Message: Sean Egan's tab-completion patch. Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- buddy_chat.c 2001/09/28 09:33:38 1.118 +++ buddy_chat.c 2001/09/28 12:15:54 1.119 @@ -440,6 +440,163 @@ gtk_widget_show(invite); } +void tab_complete(struct conversation *c) +{ + int pos = GTK_EDITABLE(c->entry)->current_pos; + int start = pos; + int most_matched = -1; + char *entered, *partial = NULL; + char *text; + GList *matches = NULL; + GList *nicks = c->in_room; + + /* if there's nothing there just return */ + if (!start) + return; + + text = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, pos); + + /* if we're at the end of ": " we need to move back 2 spaces */ + if (start >= 2 && text[start - 1] == ' ' && text[start - 2] == ':') + start -= 2; + + /* find the start of the word that we're tabbing */ + while (start > 0 && text[start - 1] != ' ') + start--; + + entered = text + start; + if (chat_options & OPT_CHAT_OLD_STYLE_TAB) { + if (strlen(entered) >= 2 && !strncmp(": ", entered + strlen(entered) - 2, 2)) + entered[strlen(entered) - 2] = 0; + } + + if (!strlen(entered)) { + g_free(text); + return; + } + + debug_printf("checking tab-completion for %s\n", entered); + + while (nicks) { + char *nick = nicks->data; + /* this checks to see if the current nick could be a completion */ + if (g_strncasecmp(nick, entered, strlen(entered))) { + if (nick[0] != '+' && nick[0] != '@') { + nicks = nicks->next; + continue; + } + if (g_strncasecmp(nick + 1, entered, strlen(entered))) { + if (nick[0] != '@' && nick[1] != '+') { + nicks = nicks->next; + continue; + } + if (g_strncasecmp(nick + 2, entered, strlen(entered))) { + nicks = nicks->next; + continue; + } + else + nick += 2; + } else + nick++; + } + /* if we're here, it's a possible completion */ + debug_printf("possible completion: %s\n", nick); + + /* if we're doing old-style, just fill in the completion */ + if (chat_options & OPT_CHAT_OLD_STYLE_TAB) { + gtk_editable_delete_text(GTK_EDITABLE(c->entry), start, pos); + if (strlen(nick) == strlen(entered)) { + nicks = nicks->next ? nicks->next : c->in_room; + nick = nicks->data; + if (*nick == '@') + nick++; + if (*nick == '+') + nick++; + } + + if (start == 0) { + char *tmp = g_strdup_printf("%s: ", nick); + int t = start; + gtk_editable_insert_text(GTK_EDITABLE(c->entry), tmp, strlen(tmp), &start); + if (t == start) { + t = start + strlen(tmp); + gtk_editable_set_position(GTK_EDITABLE(c->entry), t); + } + g_free(tmp); + } else { + int t = start; + gtk_editable_insert_text(GTK_EDITABLE(c->entry), nick, strlen(nick), &start); + if (t == start) { + t = start + strlen(nick); + gtk_editable_set_position(GTK_EDITABLE(c->entry), t); + } + } + g_free(text); + return; + } + + /* we're only here if we're doing new style */ + if (most_matched == -1) { + /* this will only get called once, since from now on most_matched is >= 0 */ + most_matched = strlen(nick); + partial = g_strdup(nick); + } else if (most_matched) { + while (g_strncasecmp(nick, partial, most_matched)) + most_matched--; + partial[most_matched] = 0; + } + matches = g_list_append(matches, nick); + + nicks = nicks->next; + } + /* we're only here if we're doing new style */ + + /* if there weren't any matches, return */ + if (!matches) { + /* if matches isn't set partials won't be either */ + g_free(text); + return; + } + + gtk_editable_delete_text(GTK_EDITABLE(c->entry), start, pos); + if (!matches->next) { + /* there was only one match. fill it in. */ + if (start == 0) { + char *tmp = g_strdup_printf("%s: ", (char *)matches->data); + int t = start; + gtk_editable_insert_text(GTK_EDITABLE(c->entry), tmp, strlen(tmp), &start); + if (t == start) { + t = start + strlen(tmp); + gtk_editable_set_position(GTK_EDITABLE(c->entry), t); + } + g_free(tmp); + } else { + gtk_editable_insert_text(GTK_EDITABLE(c->entry), matches->data, strlen(matches->data), &start); + } + matches = g_list_remove(matches, matches->data); + } else { + /* there were lots of matches, fill in as much as possible and display all of them */ + char *addthis = g_malloc0(1); + int t = start; + while (matches) { + char *tmp = addthis; + addthis = g_strconcat(tmp, matches->data, " ", NULL); + g_free(tmp); + matches = g_list_remove(matches, matches->data); + } + write_to_conv(c, addthis, WFLAG_NOLOG, NULL, time(NULL)); + gtk_editable_insert_text(GTK_EDITABLE(c->entry), partial, strlen(partial), &start); + if (t == start) { + t = start + strlen(partial); + gtk_editable_set_position(GTK_EDITABLE(c->entry), t); + } + g_free(addthis); + } + + g_free(text); + g_free(partial); +} + gboolean meify(char *message) { /* read /me-ify : if the message (post-HTML) starts with /me, remove Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.268 retrieving revision 1.269 diff -u -d -r1.268 -r1.269 --- conversation.c 2001/09/28 01:25:02 1.268 +++ conversation.c 2001/09/28 12:15:54 1.269 @@ -755,6 +755,9 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } } + } else if ((event->keyval == GDK_Tab) && c->is_chat && (chat_options & OPT_CHAT_TAB_COMPLETE)) { + tab_complete(c); + gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) && (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) && (event->keyval > '0')) { @@ -1396,7 +1399,7 @@ c->history = g_string_append(c->history, "<BR>\n"); } - if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { + if (!(flags & WFLAG_NOLOG) && ((logging_options & OPT_LOG_ALL) || find_log_info(c->name))) { char *t1; char nm[256]; @@ -1422,7 +1425,9 @@ g_free(t1); } } - + } else if (flags & WFLAG_NOLOG) { + g_snprintf(buf, BUF_LONG, "<B><FONT COLOR=\"#777777\">%s</FONT></B><BR>", what); + gtk_imhtml_append_text(GTK_IMHTML(c->text), buf, 0); } else { if (flags & WFLAG_WHISPER) { /* if we're whispering, it's not an autoresponse */ @@ -1499,7 +1504,7 @@ g_free(t2); } - if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { + if (!(flags & WFLAG_NOLOG) && ((logging_options & OPT_LOG_ALL) || find_log_info(c->name))) { char *t1, *t2; char *nm = g_malloc(256); if (c->is_chat) Index: convo.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/convo.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- convo.h 2001/09/28 01:25:02 1.10 +++ convo.h 2001/09/28 12:15:54 1.11 @@ -41,6 +41,7 @@ extern void ignore_callback(GtkWidget *, struct conversation *); extern void whisper_callback(GtkWidget *, struct conversation *); extern void invite_callback(GtkWidget *, struct conversation *); +extern void tab_complete(struct conversation *c); /* now IM */ extern void warn_callback(GtkWidget *, struct conversation *); Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.269 retrieving revision 1.270 diff -u -d -r1.269 -r1.270 --- gaim.h 2001/09/28 07:46:36 1.269 +++ gaim.h 2001/09/28 12:15:54 1.270 @@ -70,6 +70,7 @@ #define WFLAG_FILERECV 0x10 #define WFLAG_SYSTEM 0x20 #define WFLAG_NICK 0x40 +#define WFLAG_NOLOG 0x80 #define AUTO_RESPONSE "<AUTO-REPLY> : " @@ -528,6 +529,8 @@ #define OPT_CHAT_POPUP 0x00000010 #define OPT_CHAT_SIDE_TAB 0x00000020 #define OPT_CHAT_BR_TAB 0x00000040 +#define OPT_CHAT_TAB_COMPLETE 0x00000080 +#define OPT_CHAT_OLD_STYLE_TAB 0x00000100 extern guint font_options; #define OPT_FONT_BOLD 0x00000001 Index: prefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prefs.c,v retrieving revision 1.182 retrieving revision 1.183 diff -u -d -r1.182 -r1.183 --- prefs.c 2001/09/27 19:17:10 1.182 +++ prefs.c 2001/09/28 12:15:54 1.183 @@ -984,6 +984,8 @@ GtkWidget *button; GtkWidget *hbox2; GtkWidget *vbox3; + GtkWidget *tab; + GtkWidget *old; parent = prefdialog->parent; gtk_widget_destroy(prefdialog); @@ -1085,6 +1087,29 @@ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); opt = tab_radio(_("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB | 1, vbox3, opt); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), opt); + + frame = gtk_frame_new(_("Tab Completion")); + gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); + gtk_widget_show(frame); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(frame), hbox); + gtk_widget_show(hbox); + + vbox = gtk_vbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); + gtk_widget_show(vbox); + + tab = gaim_button(_("Tab-Complete Nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); + + vbox = gtk_vbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); + gtk_widget_show(vbox); + + old = gaim_button(_("Old-Style Tab Completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); + if (!(chat_options & OPT_CHAT_TAB_COMPLETE)) + gtk_widget_set_sensitive(GTK_WIDGET(old), FALSE); + gtk_signal_connect(GTK_OBJECT(tab), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), old); gtk_widget_show(prefdialog); } |
From: Eric W. <war...@us...> - 2001-09-28 12:15:56
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv4917 Modified Files: ChangeLog TODO Log Message: Sean Egan's tab-completion patch. Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.304 retrieving revision 1.305 diff -u -d -r1.304 -r1.305 --- ChangeLog 2001/09/24 16:49:32 1.304 +++ ChangeLog 2001/09/28 12:15:54 1.305 @@ -8,6 +8,9 @@ SIGNALS) * Some GtkIMHtml improvements * Various bugfixes + * Nick Highlighting in chat + * Tab-completion for nicks in chat (thanks to Sean Egan) + * Large internal reworkings version 0.44 (09/20/2001): * More sane scaling of buddy icons (intelligently scale to Index: TODO =================================================================== RCS file: /cvsroot/gaim/gaim/TODO,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- TODO 2001/09/25 20:00:05 1.119 +++ TODO 2001/09/28 12:15:54 1.120 @@ -2,22 +2,18 @@ GPG Encryption of messages Have plugin_event use varargs instead of void* Separate core functions from UI stuff. - about.c, applet.[ch], away.c, conversation.c, convo.h, multi.c, - gtk*, prefs.c, prpl.c, sound.c, ticker.c + about.c, applet.[ch], away.c, buddy.c, conversation.c, convo.h, + dialogs.c, multi.c, gtk*, prefs.c, prpl.c, sound.c, ticker.c little to no work (mostly GTK) - gaimrc.c, html.c, proxy.[ch], prpl.h, server.c, util.c + gaimrc.c, html.c, list.c, proxy.[ch], prpl.h, server.c, util.c little to no work (mostly CORE) aim.c - need to redo main() completely - current main should be moved mostly to core - GTK main should connect to core browser.c - let the UI deal with this? little to no work. - buddy.c - need to split into buddy.c and list.c - - buddy.c handles add/remove/rename/alias buddies - - list.c handles drawing the buddy list for GTK buddy_chat.c - need to move out non-GTK functions. some work. - dialogs.c - need to move import/export out of here and into buddy.c gaim.h - need to separate into core.h and ui.h. idle.c - Need to figure out how to report idle times when there's more than one UI |
From: Eric W. <war...@us...> - 2001-09-28 09:33:41
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv5449 Modified Files: buddy_chat.c Log Message: this won't break anything. Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- buddy_chat.c 2001/09/27 20:32:59 1.117 +++ buddy_chat.c 2001/09/28 09:33:38 1.118 @@ -481,7 +481,7 @@ g_strdown(who); if ((p = strstr(msg, who)) != NULL) { - if ((p == msg) || (!isalnum(*(p - 1)) && !isalnum(*(p + n)))) { + if (((p == msg) || !isalnum(*(p - 1))) && !isalnum(*(p + n))) { g_free(who); g_free(msg); return TRUE; @@ -499,7 +499,7 @@ g_strdown(who); if ((p = strstr(msg, who)) != NULL) { - if ((p == msg) || (!isalnum(*(p - 1)) && !isalnum(*(p + n)))) { + if (((p == msg) || !isalnum(*(p - 1))) && !isalnum(*(p + n))) { g_free(who); g_free(msg); return TRUE; |
From: Eric W. <war...@us...> - 2001-09-28 08:51:49
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv28793 Modified Files: gaimrc.c Log Message: fixes Index: gaimrc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- gaimrc.c 2001/09/28 01:25:02 1.82 +++ gaimrc.c 2001/09/28 08:51:46 1.83 @@ -256,6 +256,12 @@ default_away = g_slist_nth_data(away_messages, atoi(p->value[1])); } } + if (!away_messages) { + a = g_new0(struct away_message, 1); + g_snprintf(a->name, sizeof(a->name), "boring default"); + g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG); + away_messages = g_slist_append(away_messages, a); + } } static void gaimrc_write_away(FILE *f) @@ -956,15 +962,7 @@ static void set_defaults() { int i; - - if (aim_users) { - g_list_free(aim_users); - aim_users = NULL; - } - if (away_messages) { - g_slist_free(away_messages); - away_messages = NULL; - } + struct away_message *a; misc_options = OPT_MISC_BUDDY_TICKER | @@ -1013,13 +1011,18 @@ OPT_SOUND_RECV | OPT_SOUND_SEND | OPT_SOUND_SILENT_SIGNON; + report_idle = IDLE_SCREENSAVER; web_browser = BROWSER_NETSCAPE; - auto_away = 10; - default_away = NULL; - g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s"); + auto_away = 10; + a = g_new0(struct away_message, 1); + g_snprintf(a->name, sizeof(a->name), "boring default"); + g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG); + away_messages = g_slist_append(away_messages, a); + default_away = a; + blist_pos.width = 0; blist_pos.height = 0; blist_pos.x = 0; @@ -1096,6 +1099,10 @@ } else if (opt_rcfile_arg) { g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg); do_error_dialog(buf, _("Preferences Error")); + set_defaults(); + } else { + set_defaults(); + save_prefs(); } } |
From: Eric W. <war...@us...> - 2001-09-28 07:46:40
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/oscar Modified Files: oscar.c Log Message: big reorg of code. list.c contains 0 gtk. Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- oscar.c 2001/09/26 19:19:19 1.40 +++ oscar.c 2001/09/28 07:46:36 1.41 @@ -1905,7 +1905,7 @@ serv_finish_login(gc); if (bud_list_cache_exists(gc)) - do_import(NULL, gc); + do_import(gc, NULL); debug_printf("buddy list loaded\n"); |
From: Eric W. <war...@us...> - 2001-09-28 07:46:40
|
Update of /cvsroot/gaim/gaim/src/protocols/zephyr In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/zephyr Modified Files: zephyr.c Log Message: big reorg of code. list.c contains 0 gtk. Index: zephyr.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/zephyr/zephyr.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- zephyr.c 2001/09/17 23:25:10 1.11 +++ zephyr.c 2001/09/28 07:46:36 1.12 @@ -577,7 +577,7 @@ serv_finish_login(zgc); if (bud_list_cache_exists(zgc)) - do_import(NULL, zgc); + do_import(zgc, NULL); process_anyone(); process_zsubs(); |
From: Eric W. <war...@us...> - 2001-09-28 07:46:39
|
Update of /cvsroot/gaim/gaim/src/protocols/toc In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/toc Modified Files: toc.c Log Message: big reorg of code. list.c contains 0 gtk. Index: toc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- toc.c 2001/09/27 17:44:23 1.23 +++ toc.c 2001/09/28 07:46:36 1.24 @@ -547,7 +547,7 @@ account_online(gc); serv_finish_login(gc); - do_import(0, gc); + do_import(gc, NULL); /* Client sends TOC toc_init_done message */ debug_printf("* Client sends TOC toc_init_done message\n"); @@ -582,7 +582,7 @@ signoff(gc); return; } - do_import(0, gc); + do_import(gc, NULL); g_snprintf(snd, sizeof snd, "toc_init_done"); sflap_send(gc, snd, -1, TYPE_DATA); do_error_dialog(_("TOC has come back from its pause. You may now send" |
From: Eric W. <war...@us...> - 2001-09-28 07:46:39
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/yahoo Modified Files: yay.c Log Message: big reorg of code. list.c contains 0 gtk. Index: yay.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yay.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- yay.c 2001/09/19 06:09:15 1.15 +++ yay.c 2001/09/28 07:46:36 1.16 @@ -259,7 +259,7 @@ } if (bud_list_cache_exists(gc)) - do_import(NULL, gc); + do_import(gc, NULL); grps = yd->sess->groups; while (grps) { |
From: Eric W. <war...@us...> - 2001-09-28 07:46:39
|
Update of /cvsroot/gaim/gaim/src/protocols/napster In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/napster Modified Files: napster.c Log Message: big reorg of code. list.c contains 0 gtk. Index: napster.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/napster/napster.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- napster.c 2001/09/19 06:09:15 1.11 +++ napster.c 2001/09/28 07:46:36 1.12 @@ -392,7 +392,7 @@ serv_finish_login(gc); if (bud_list_cache_exists(gc)) - do_import(NULL, gc); + do_import(gc, NULL); return; } |
From: Eric W. <war...@us...> - 2001-09-28 07:46:39
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv11370 Modified Files: Makefile.am buddy.c dialogs.c gaim.h multi.c server.c util.c Added Files: list.c Log Message: big reorg of code. list.c contains 0 gtk. --- NEW FILE: list.c --- /* * gaim * * Copyright (C) 1998-1999, Mark Spencer <mar...@ma...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "gaim.h" #include "prpl.h" #define PATHSIZE 1024 void remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b) { GSList *grp; GSList *mem; struct group *delg; struct buddy *delb; /* we assume that gc is not NULL and that the buddy exists somewhere within the * gc's buddy list, therefore we can safely remove it. we need to ensure this * via the UI */ grp = g_slist_find(gc->groups, rem_g); delg = (struct group *)grp->data; mem = delg->members; mem = g_slist_find(mem, rem_b); delb = (struct buddy *)mem->data; delg->members = g_slist_remove(delg->members, delb); ui_remove_buddy(gc, rem_g, rem_b); g_free(rem_b); /* we don't flush buddy list to cache because in the case of remove_group that would * mean writing to the buddy list file once for each buddy, plus one more time */ } void remove_group(struct gaim_connection *gc, struct group *rem_g) { GSList *grp; GSList *mem; GList *tmp = NULL; struct group *delg; struct buddy *delb; /* we assume that the group actually does exist within the gc, and that the gc is not NULL. * the UI is responsible for this */ grp = g_slist_find(gc->groups, rem_g); delg = (struct group *)grp->data; mem = delg->members; while (delg->members) { delb = (struct buddy *)delg->members->data; tmp = g_list_append(tmp, g_strdup(delb->name)); remove_buddy(gc, delg, delb); /* this should take care of removing the group_show if necessary */ } gc->groups = g_slist_remove(gc->groups, delg); serv_remove_buddies(gc, tmp); while (tmp) { g_free(tmp->data); tmp = g_list_remove(tmp, tmp->data); } ui_remove_group(gc, rem_g); g_free(rem_g); /* don't flush buddy list to cache in order to be consistent with remove_buddy, * mostly. remove_group is only called from one place, so we'll let it handle it. */ } struct buddy *add_buddy(struct gaim_connection *gc, char *group, char *buddy, char *show) { struct buddy *b; struct group *g; char *good; if ((b = find_buddy(gc, buddy)) != NULL) return b; g = find_group(gc, group); if (g == NULL) g = add_group(gc, group); b = (struct buddy *)g_new0(struct buddy, 1); if (!b) return NULL; b->gc = gc; b->present = 0; if (gc->prpl->normalize) good = (*gc->prpl->normalize)(buddy); else good = buddy; g_snprintf(b->name, sizeof(b->name), "%s", good); g_snprintf(b->show, sizeof(b->show), "%s", show ? (show[0] ? show : good) : good); g->members = g_slist_append(g->members, b); b->idle = 0; b->caps = 0; ui_add_buddy(gc, g, b); return b; } struct group *add_group(struct gaim_connection *gc, char *group) { struct group *g = find_group(gc, group); if (g) return g; g = (struct group *)g_new0(struct group, 1); if (!g) return NULL; g->gc = gc; strncpy(g->name, group, sizeof(g->name)); gc->groups = g_slist_append(gc->groups, g); g->members = NULL; ui_add_group(gc, g); return g; } struct group *find_group(struct gaim_connection *gc, char *group) { struct group *g; GSList *grp; GSList *c = connections; struct gaim_connection *z; char *grpname = g_malloc(strlen(group) + 1); strcpy(grpname, normalize (group)); if (gc) { grp = gc->groups; while (grp) { g = (struct group *)grp->data; if (!g_strcasecmp(normalize (g->name), grpname)) { g_free(grpname); return g; } grp = g_slist_next(grp); } g_free(grpname); return NULL; } else { while (c) { z = (struct gaim_connection *)c->data; grp = z->groups; while (grp) { g = (struct group *)grp->data; if (!g_strcasecmp(normalize (g->name), grpname)) { g_free(grpname); return g; } grp = g_slist_next(grp); } c = c->next; } g_free(grpname); return NULL; } } struct group *find_group_by_buddy(struct gaim_connection *gc, char *who) { struct group *g; struct buddy *b; GSList *grp; GSList *mem; char *whoname; char *(*norm)(const char *); if (gc) { if (gc->prpl->normalize) norm = gc->prpl->normalize; else norm = normalize; whoname = g_strdup((*norm)(who)); grp = gc->groups; while (grp) { g = (struct group *)grp->data; mem = g->members; while (mem) { b = (struct buddy *)mem->data; if (!strcmp((*norm)(b->name), whoname)) { g_free(whoname); return g; } mem = mem->next; } grp = g_slist_next(grp); } g_free(whoname); return NULL; } else { GSList *c = connections; struct gaim_connection *z; while (c) { z = (struct gaim_connection *)c->data; if (z->prpl->normalize) norm = z->prpl->normalize; else norm = normalize; whoname = g_strdup((*norm)(who)); grp = z->groups; while (grp) { g = (struct group *)grp->data; mem = g->members; while (mem) { b = (struct buddy *)mem->data; if (!strcmp((*norm)(b->name), whoname)) { g_free(whoname); return g; } mem = mem->next; } grp = g_slist_next(grp); } c = c->next; g_free(whoname); } return NULL; } } struct buddy *find_buddy(struct gaim_connection *gc, char *who) { struct group *g; struct buddy *b; GSList *grp; GSList *c; struct gaim_connection *z; GSList *mem; char *whoname; char *(*norm)(const char *); if (gc) { if (gc->prpl->normalize) norm = gc->prpl->normalize; else norm = normalize; whoname = g_strdup((*norm)(who)); grp = gc->groups; while (grp) { g = (struct group *)grp->data; mem = g->members; while (mem) { b = (struct buddy *)mem->data; if (!strcmp((*norm)(b->name), whoname)) { g_free(whoname); return b; } mem = mem->next; } grp = g_slist_next(grp); } g_free(whoname); return NULL; } else { c = connections; while (c) { z = (struct gaim_connection *)c->data; if (z->prpl->normalize) norm = z->prpl->normalize; else norm = normalize; whoname = g_strdup((*norm)(who)); grp = z->groups; while (grp) { g = (struct group *)grp->data; mem = g->members; while (mem) { b = (struct buddy *)mem->data; if (!strcmp((*norm)(b->name), whoname)) { g_free(whoname); return b; } mem = mem->next; } grp = g_slist_next(grp); } c = c->next; g_free(whoname); } return NULL; } } void parse_toc_buddy_list(struct gaim_connection *gc, char *config, int from_do_import) { char *c; char current[256]; char *name; GList *bud; int how_many = 0; bud = NULL; if (config != NULL) { /* skip "CONFIG:" (if it exists) */ c = strncmp(config + 6 /* sizeof(struct sflap_hdr) */ , "CONFIG:", strlen("CONFIG:")) ? strtok(config, "\n") : strtok(config + 6 /* sizeof(struct sflap_hdr) */ + strlen("CONFIG:"), "\n"); do { if (c == NULL) break; if (*c == 'g') { strncpy(current, c + 2, sizeof(current)); add_group(gc, current); how_many++; } else if (*c == 'b' && !find_buddy(gc, c + 2)) { char nm[80], sw[80], *tmp = c + 2; int i = 0; while (*tmp != ':' && *tmp) nm[i++] = *tmp++; if (*tmp == ':') *tmp++ = '\0'; nm[i] = '\0'; i = 0; while (*tmp) sw[i++] = *tmp++; sw[i] = '\0'; if (!find_buddy(gc, nm)) add_buddy(gc, current, nm, sw); how_many++; bud = g_list_append(bud, c + 2); } else if (*c == 'p') { GSList *d = gc->permit; char *n; name = g_malloc(strlen(c + 2) + 2); g_snprintf(name, strlen(c + 2) + 1, "%s", c + 2); n = g_strdup(normalize (name)); while (d) { if (!g_strcasecmp(n, normalize (d->data))) break; d = d->next; } g_free(n); if (!d) gc->permit = g_slist_append(gc->permit, name); else g_free(name); } else if (*c == 'd') { GSList *d = gc->deny; char *n; name = g_malloc(strlen(c + 2) + 2); g_snprintf(name, strlen(c + 2) + 1, "%s", c + 2); n = g_strdup(normalize (name)); while (d) { if (!g_strcasecmp(n, normalize (d->data))) break; d = d->next; } g_free(n); if (!d) gc->deny = g_slist_append(gc->deny, name); else g_free(name); } else if (!strncmp("toc", c, 3)) { sscanf(c + strlen(c) - 1, "%d", &gc->permdeny); debug_printf("permdeny: %d\n", gc->permdeny); if (gc->permdeny == 0) gc->permdeny = 1; } else if (*c == 'm') { sscanf(c + 2, "%d", &gc->permdeny); debug_printf("permdeny: %d\n", gc->permdeny); if (gc->permdeny == 0) gc->permdeny = 1; } } while ((c = strtok(NULL, "\n"))); if (bud != NULL) { serv_add_buddies(gc, bud); g_list_free(bud); } serv_set_permit_deny(gc); } /* perhaps the server dropped the buddy list, try importing from cache */ if (how_many == 0 && !from_do_import) { do_import(gc, NULL); } else if (gc && (bud_list_cache_exists(gc) == FALSE)) { do_export(gc); } } void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show) { GSList *grp = gc->groups; GSList *mem; struct group *g; struct buddy *b; GSList *plist = gc->permit; GSList *dlist = gc->deny; int pos = 0; if (!gc->permdeny) gc->permdeny = 1; pos += g_snprintf(&s[pos], len - pos, "m %d\n", gc->permdeny); while (len > pos && grp) { g = (struct group *)grp->data; pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); mem = g->members; while (len > pos && mem) { b = (struct buddy *)mem->data; pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, (show && strcmp(b->name, b->show)) ? ":" : "", (show && strcmp(b->name, b->show)) ? b->show : ""); mem = mem->next; } grp = g_slist_next(grp); } while (len > pos && plist) { pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); plist = plist->next; } while (len > pos && dlist) { pos += g_snprintf(&s[pos], len - pos, "d %s\n", (char *)dlist->data); dlist = dlist->next; } } /* remove leading whitespace from a string */ static char *remove_spaces(char *str) { int i; char *new; if (str == NULL) return NULL; i = strspn(str, " \t\n\r\f"); new = &str[i]; return new; } /* translate an AIM 3 buddylist (*.lst) to a GAIM buddylist */ static void translate_lst(FILE *src_fp, char *dest) { char line[BUF_LEN], *line2; char *name; int i; sprintf(dest, "m 1\n"); while (fgets(line, BUF_LEN, src_fp)) { line2 = remove_spaces(line); if (strstr(line2, "group") == line2) { name = strpbrk(line2, " \t\n\r\f") + 1; strcat(dest, "g "); for (i = 0; i < strcspn(name, "\n\r"); i++) if (name[i] != '\"') strncat(dest, &name[i], 1); strcat(dest, "\n"); } if (strstr(line2, "buddy") == line2) { name = strpbrk(line2, " \t\n\r\f") + 1; strcat(dest, "b "); for (i = 0; i < strcspn(name, "\n\r"); i++) if (name[i] != '\"') strncat(dest, &name[i], 1); strcat(dest, "\n"); } } return; } /* translate an AIM 4 buddylist (*.blt) to GAIM format */ static void translate_blt(FILE *src_fp, char *dest) { int i; char line[BUF_LEN]; char *buddy; sprintf(dest, "m 1\n"); while (strstr(fgets(line, BUF_LEN, src_fp), "Buddy") == NULL); while (strstr(fgets(line, BUF_LEN, src_fp), "list") == NULL); while (1) { fgets(line, BUF_LEN, src_fp); if (strchr(line, '}') != NULL) break; /* Syntax starting with "<group> {" */ if (strchr(line, '{') != NULL) { strcat(dest, "g "); buddy = remove_spaces(strtok(line, "{")); for (i = 0; i < strlen(buddy); i++) { if (buddy[i] != '\"') strncat(dest, &buddy[i], 1); } strcat(dest, "\n"); while (strchr(fgets(line, BUF_LEN, src_fp), '}') == NULL) { buddy = remove_spaces(line); strcat(dest, "b "); if (strchr(buddy, '\"') != NULL) { buddy++; strncat(dest, buddy, strchr(buddy, '\"') - buddy); strcat(dest, "\n"); } else strcat(dest, buddy); } } /* Syntax "group buddy buddy ..." */ else { buddy = remove_spaces(strtok(line, " \n")); strcat(dest, "g "); if (strchr(buddy, '\"') != NULL) { strcat(dest, &buddy[1]); strcat(dest, " "); buddy = remove_spaces(strtok(NULL, " \n")); while (strchr(buddy, '\"') == NULL) { strcat(dest, buddy); strcat(dest, " "); buddy = remove_spaces(strtok(NULL, " \n")); } strncat(dest, buddy, strlen(buddy) - 1); } else { strcat(dest, buddy); } strcat(dest, "\n"); while ((buddy = remove_spaces(strtok(NULL, " \n"))) != NULL) { strcat(dest, "b "); if (strchr(buddy, '\"') != NULL) { strcat(dest, &buddy[1]); strcat(dest, " "); buddy = remove_spaces(strtok(NULL, " \n")); while (strchr(buddy, '\"') == NULL) { strcat(dest, buddy); strcat(dest, " "); buddy = remove_spaces(strtok(NULL, " \n")); } strncat(dest, buddy, strlen(buddy) - 1); } else { strcat(dest, buddy); } strcat(dest, "\n"); } } } return; } static gchar *get_screenname_filename(const char *name) { gchar **split; gchar *good; split = g_strsplit(name, G_DIR_SEPARATOR_S, -1); good = g_strjoinv(NULL, split); g_strfreev(split); g_strup(good); return good; } /* see if a buddy list cache file for this user exists */ gboolean bud_list_cache_exists(struct gaim_connection *gc) { gboolean ret = FALSE; char path[PATHSIZE]; char *file; struct stat sbuf; char *g_screenname; g_screenname = get_screenname_filename(gc->username); file = gaim_user_dir(); if (file != (char *)NULL) { g_snprintf(path, sizeof path, "%s/%s.%d.blist", file, g_screenname, (gc->protocol == PROTO_OSCAR) ? PROTO_TOC : gc->protocol); if (!stat(path, &sbuf)) { debug_printf("%s exists.\n", path); ret = TRUE; } else { char path2[PATHSIZE]; debug_printf("%s does not exist.\n", path); g_snprintf(path2, sizeof path2, "%s/%s.blist", file, g_screenname); if (!stat(path2, &sbuf)) { debug_printf("%s exists, moving to %s\n", path2, path); if (rename(path2, path)) debug_printf("rename didn't work!\n"); else ret = TRUE; } } g_free(file); } g_free(g_screenname); return ret; } void do_import(struct gaim_connection *gc, char *filename) { char *buf = g_malloc(BUF_LONG * 2); char *buf2; char *first = g_malloc(64); char *file; char path[PATHSIZE]; char *g_screenname; int len; FILE *f; if (filename) { g_snprintf(path, sizeof(path), "%s", filename); } else { g_screenname = get_screenname_filename(gc->username); file = gaim_user_dir(); if (file != (char *)NULL) { sprintf(path, "%s/%s.%d.blist", file, g_screenname, (gc->protocol == PROTO_OSCAR) ? PROTO_TOC : gc->protocol); g_free(file); g_free(g_screenname); } else { g_free(g_screenname); g_free(buf); g_free(first); return; } } if (!(f = fopen(path, "r"))) { debug_printf("Unable to open %s.\n", path); g_free(buf); g_free(first); return; } fgets(first, 64, f); /* AIM 4 buddy list */ if (!g_strncasecmp(first, "Config {", strlen("Config {"))) { debug_printf("aim 4\n"); rewind(f); translate_blt(f, buf); debug_printf("%s\n", buf); buf2 = buf; buf = g_malloc(8193); g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); g_free(buf2); /* AIM 3 buddy list */ } else if (strstr(first, "group") != NULL) { debug_printf("aim 3\n"); rewind(f); translate_lst(f, buf); debug_printf("%s\n", buf); buf2 = buf; buf = g_malloc(8193); g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); g_free(buf2); /* GAIM buddy list - no translation */ } else if (first[0] == 'm') { rewind(f); len = fread(buf, 1, BUF_LONG * 2, f); buf[len] = '\0'; buf2 = buf; buf = g_malloc(8193); g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); g_free(buf2); /* Something else */ } else { g_free(buf); g_free(first); fclose(f); return; } parse_toc_buddy_list(gc, buf, 1); fclose(f); g_free(buf); g_free(first); } void do_export(struct gaim_connection *g) { FILE *dir; FILE *f; char buf[32 * 1024]; char *file; char path[PATHSIZE]; char *g_screenname; file = gaim_user_dir(); if (!file) return; strcpy(buf, file); dir = fopen(buf, "r"); if (!dir) mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); else fclose(dir); g_screenname = get_screenname_filename(g->username); sprintf(path, "%s/%s.%d.blist", file, g_screenname, (g->protocol == PROTO_OSCAR) ? PROTO_TOC : g->protocol); if ((f = fopen(path, "w"))) { debug_printf("writing %s\n", path); toc_build_config(g, buf, 8192 - 1, TRUE); fprintf(f, "%s\n", buf); fclose(f); chmod(buf, S_IRUSR | S_IWUSR); } else { debug_printf("unable to write %s\n", path); } g_free(g_screenname); g_free(file); } Index: Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/src/Makefile.am,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Makefile.am 2001/09/27 19:27:52 1.38 +++ Makefile.am 2001/09/28 07:46:35 1.39 @@ -17,6 +17,7 @@ gtkticker.c \ html.c \ idle.c \ + list.c \ multi.c \ perl.c \ plugins.c \ @@ -47,6 +48,7 @@ gtkticker.c \ html.c \ idle.c \ + list.c \ multi.c \ perl.c \ plugins.c \ Index: buddy.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy.c,v retrieving revision 1.246 retrieving revision 1.247 diff -u -d -r1.246 -r1.247 --- buddy.c 2001/09/28 02:16:34 1.246 +++ buddy.c 2001/09/28 07:46:35 1.247 @@ -794,31 +794,12 @@ } -void remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b) +void ui_remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b) { - GSList *grp; - GSList *mem; struct conversation *c; struct group_show *gs; struct buddy_show *bs; - struct group *delg; - struct buddy *delb; - - /* we assume that gc is not NULL and that the buddy exists somewhere within the - * gc's buddy list, therefore we can safely remove it. we need to ensure this - * via the UI - */ - - grp = g_slist_find(gc->groups, rem_g); - delg = (struct group *)grp->data; - mem = delg->members; - - mem = g_slist_find(mem, rem_b); - delb = (struct buddy *)mem->data; - - delg->members = g_slist_remove(delg->members, delb); - gs = find_group_show(rem_g->name); if (gs) { bs = find_buddy_show(gs, rem_b->name); @@ -850,63 +831,23 @@ update_num_group(gs); } - c = find_conversation(delb->name); + c = find_conversation(rem_b->name); if (c) update_buttons_by_protocol(c); - g_free(delb); - - /* we don't flush buddy list to cache because in the case of remove_group that would - * mean writing to the buddy list file once for each buddy, plus one more time */ } -void remove_group(struct gaim_connection *gc, struct group *rem_g) +void ui_remove_group(struct gaim_connection *gc, struct group *rem_g) { - GSList *grp; - GSList *mem; struct group_show *gs; - GList *tmp = NULL; - - struct group *delg; - struct buddy *delb; - - /* we assume that the group actually does exist within the gc, and that the gc is not NULL. - * the UI is responsible for this */ - - grp = g_slist_find(gc->groups, rem_g); - delg = (struct group *)grp->data; - mem = delg->members; - while (delg->members) { - delb = (struct buddy *)delg->members->data; - tmp = g_list_append(tmp, g_strdup(delb->name)); - remove_buddy(gc, delg, delb); /* this should take care of removing - the group_show if necessary */ - } - - gc->groups = g_slist_remove(gc->groups, delg); - - if ((gs = find_group_show(delg->name)) != NULL) { + if ((gs = find_group_show(rem_g->name)) != NULL) { shows = g_slist_remove(shows, gs); gtk_tree_remove_item(GTK_TREE(buddies), gs->item); g_free(gs->name); g_free(gs); } - g_free(delg); - - serv_remove_buddies(gc, tmp); - while (tmp) { - g_free(tmp->data); - tmp = g_list_remove(tmp, tmp->data); - } - - /* don't flush buddy list to cache in order to be consistent with remove_buddy, - * mostly. remove_group is only called from one place, so we'll let it handle it. */ } - - - - gboolean edit_drag_compare_func(GtkCTree *ctree, GtkCTreeNode *source_node, GtkCTreeNode *new_parent, GtkCTreeNode *new_sibling) { @@ -1233,51 +1174,20 @@ } -struct buddy *add_buddy(struct gaim_connection *gc, char *group, char *buddy, char *show) +void ui_add_buddy(struct gaim_connection *gc, struct group *g, struct buddy *b) { GtkCTreeNode *p = NULL, *n; char *text[1]; char buf[256]; - struct buddy *b; - struct group *g; - struct group_show *gs = find_group_show(group); - char *good; - - if ((b = find_buddy(gc, buddy)) != NULL) - return b; - - g = find_group(gc, group); - - if (g == NULL) - g = add_group(gc, group); - - b = (struct buddy *)g_new0(struct buddy, 1); - - if (!b) - return NULL; + struct group_show *gs = find_group_show(g->name); b->edittype = EDIT_BUDDY; - b->gc = gc; - b->present = 0; - - if (gc->prpl->normalize) - good = (*gc->prpl->normalize)(buddy); - else - good = buddy; - g_snprintf(b->name, sizeof(b->name), "%s", good); - g_snprintf(b->show, sizeof(b->show), "%s", show ? (show[0] ? show : good) : good); - - g->members = g_slist_append(g->members, b); - - b->idle = 0; - b->caps = 0; - if (gs) update_num_group(gs); if (!blist) - return b; + return; p = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, g); if (strcmp(b->name, b->show)) { @@ -1288,41 +1198,25 @@ n = gtk_ctree_insert_node(GTK_CTREE(edittree), p, NULL, text, 5, NULL, NULL, NULL, NULL, 1, 1); gtk_ctree_node_set_row_data(GTK_CTREE(edittree), n, b); - - return b; } - -struct group *add_group(struct gaim_connection *gc, char *group) +void ui_add_group(struct gaim_connection *gc, struct group *g) { GtkCTreeNode *c = NULL, *p; char *text[1]; - struct group *g = find_group(gc, group); - if (g) - return g; - g = (struct group *)g_new0(struct group, 1); - if (!g) - return NULL; g->edittype = EDIT_GROUP; - g->gc = gc; - strncpy(g->name, group, sizeof(g->name)); - gc->groups = g_slist_append(gc->groups, g); - g->members = NULL; - if (!blist) - return g; + return; c = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, gc); text[0] = g->name; p = gtk_ctree_insert_node(GTK_CTREE(edittree), c, NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1); gtk_ctree_node_set_row_data(GTK_CTREE(edittree), p, g); - - if (!(blist_options & OPT_BLIST_NO_MT_GRP) && !find_group_show(group)) - new_group_show(group); - return g; + if (!(blist_options & OPT_BLIST_NO_MT_GRP) && !find_group_show(g->name)) + new_group_show(g->name); } @@ -1513,180 +1407,6 @@ gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 1, time(NULL)); } -struct group *find_group(struct gaim_connection *gc, char *group) -{ - struct group *g; - GSList *grp; - GSList *c = connections; - struct gaim_connection *z; - char *grpname = g_malloc(strlen(group) + 1); - - strcpy(grpname, normalize (group)); - if (gc) { - grp = gc->groups; - while (grp) { - g = (struct group *)grp->data; - if (!g_strcasecmp(normalize (g->name), grpname)) { - g_free(grpname); - return g; - } - grp = g_slist_next(grp); - } - - g_free(grpname); - return NULL; - } else { - while (c) { - z = (struct gaim_connection *)c->data; - grp = z->groups; - while (grp) { - g = (struct group *)grp->data; - if (!g_strcasecmp(normalize (g->name), grpname)) { - g_free(grpname); - return g; - } - grp = g_slist_next(grp); - } - - c = c->next; - } - g_free(grpname); - return NULL; - } -} - - -struct group *find_group_by_buddy(struct gaim_connection *gc, char *who) -{ - struct group *g; - struct buddy *b; - GSList *grp; - GSList *mem; - char *whoname; - char *(*norm)(const char *); - - if (gc) { - if (gc->prpl->normalize) - norm = gc->prpl->normalize; - else - norm = normalize; - whoname = g_strdup((*norm)(who)); - grp = gc->groups; - while (grp) { - g = (struct group *)grp->data; - - mem = g->members; - while (mem) { - b = (struct buddy *)mem->data; - if (!strcmp((*norm)(b->name), whoname)) { - g_free(whoname); - return g; - } - mem = mem->next; - } - grp = g_slist_next(grp); - } - g_free(whoname); - return NULL; - } else { - GSList *c = connections; - struct gaim_connection *z; - while (c) { - z = (struct gaim_connection *)c->data; - if (z->prpl->normalize) - norm = z->prpl->normalize; - else - norm = normalize; - whoname = g_strdup((*norm)(who)); - grp = z->groups; - while (grp) { - g = (struct group *)grp->data; - - mem = g->members; - while (mem) { - b = (struct buddy *)mem->data; - if (!strcmp((*norm)(b->name), whoname)) { - g_free(whoname); - return g; - } - mem = mem->next; - } - grp = g_slist_next(grp); - } - c = c->next; - g_free(whoname); - } - return NULL; - } -} - - -struct buddy *find_buddy(struct gaim_connection *gc, char *who) -{ - struct group *g; - struct buddy *b; - GSList *grp; - GSList *c; - struct gaim_connection *z; - GSList *mem; - char *whoname; - char *(*norm)(const char *); - - if (gc) { - if (gc->prpl->normalize) - norm = gc->prpl->normalize; - else - norm = normalize; - whoname = g_strdup((*norm)(who)); - grp = gc->groups; - while (grp) { - g = (struct group *)grp->data; - - mem = g->members; - while (mem) { - b = (struct buddy *)mem->data; - if (!strcmp((*norm)(b->name), whoname)) { - g_free(whoname); - return b; - } - mem = mem->next; - } - grp = g_slist_next(grp); - } - g_free(whoname); - return NULL; - } else { - c = connections; - while (c) { - z = (struct gaim_connection *)c->data; - if (z->prpl->normalize) - norm = z->prpl->normalize; - else - norm = normalize; - whoname = g_strdup((*norm)(who)); - grp = z->groups; - while (grp) { - g = (struct group *)grp->data; - - mem = g->members; - while (mem) { - b = (struct buddy *)mem->data; - if (!strcmp((*norm)(b->name), whoname)) { - g_free(whoname); - return b; - } - mem = mem->next; - } - grp = g_slist_next(grp); - } - c = c->next; - g_free(whoname); - } - return NULL; - } -} - - void rem_bp(GtkWidget *w, struct buddy_pounce *b) { buddy_pounces = g_list_remove(buddy_pounces, b); @@ -2895,146 +2615,4 @@ update_button_pix(); gtk_widget_show(blist); -} - -void parse_toc_buddy_list(struct gaim_connection *gc, char *config, int from_do_import) -{ - char *c; - char current[256]; - char *name; - GList *bud; - int how_many = 0; - - bud = NULL; - - if (config != NULL) { - - /* skip "CONFIG:" (if it exists) */ - c = strncmp(config + 6 /* sizeof(struct sflap_hdr) */ , "CONFIG:", strlen("CONFIG:")) ? - strtok(config, "\n") : - strtok(config + 6 /* sizeof(struct sflap_hdr) */ + strlen("CONFIG:"), "\n"); - do { - if (c == NULL) - break; - if (*c == 'g') { - strncpy(current, c + 2, sizeof(current)); - add_group(gc, current); - how_many++; - } else if (*c == 'b' && !find_buddy(gc, c + 2)) { - char nm[80], sw[80], *tmp = c + 2; - int i = 0; - while (*tmp != ':' && *tmp) - nm[i++] = *tmp++; - if (*tmp == ':') - *tmp++ = '\0'; - nm[i] = '\0'; - i = 0; - while (*tmp) - sw[i++] = *tmp++; - sw[i] = '\0'; - if (!find_buddy(gc, nm)) - add_buddy(gc, current, nm, sw); - how_many++; - - bud = g_list_append(bud, c + 2); - } else if (*c == 'p') { - GSList *d = gc->permit; - char *n; - name = g_malloc(strlen(c + 2) + 2); - g_snprintf(name, strlen(c + 2) + 1, "%s", c + 2); - n = g_strdup(normalize (name)); - while (d) { - if (!g_strcasecmp(n, normalize (d->data))) - break; - d = d->next; - } - g_free(n); - if (!d) - gc->permit = g_slist_append(gc->permit, name); - else - g_free(name); - } else if (*c == 'd') { - GSList *d = gc->deny; - char *n; - name = g_malloc(strlen(c + 2) + 2); - g_snprintf(name, strlen(c + 2) + 1, "%s", c + 2); - n = g_strdup(normalize (name)); - while (d) { - if (!g_strcasecmp(n, normalize (d->data))) - break; - d = d->next; - } - g_free(n); - if (!d) - gc->deny = g_slist_append(gc->deny, name); - else - g_free(name); - } else if (!strncmp("toc", c, 3)) { - sscanf(c + strlen(c) - 1, "%d", &gc->permdeny); - debug_printf("permdeny: %d\n", gc->permdeny); - if (gc->permdeny == 0) - gc->permdeny = 1; - } else if (*c == 'm') { - sscanf(c + 2, "%d", &gc->permdeny); - debug_printf("permdeny: %d\n", gc->permdeny); - if (gc->permdeny == 0) - gc->permdeny = 1; - } - } while ((c = strtok(NULL, "\n"))); - - if (bud != NULL) { - serv_add_buddies(gc, bud); - g_list_free(bud); - } - serv_set_permit_deny(gc); - } - - /* perhaps the server dropped the buddy list, try importing from - cache */ - - if (how_many == 0 && !from_do_import) { - do_import((GtkWidget *)NULL, gc); - } else if (gc && (bud_list_cache_exists(gc) == FALSE)) { - do_export(gc); - } -} - -void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show) -{ - GSList *grp = gc->groups; - GSList *mem; - struct group *g; - struct buddy *b; - GSList *plist = gc->permit; - GSList *dlist = gc->deny; - - int pos = 0; - - if (!gc->permdeny) - gc->permdeny = 1; - - pos += g_snprintf(&s[pos], len - pos, "m %d\n", gc->permdeny); - while (len > pos && grp) { - g = (struct group *)grp->data; - pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); - mem = g->members; - while (len > pos && mem) { - b = (struct buddy *)mem->data; - pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, - (show && strcmp(b->name, b->show)) ? ":" : "", - (show && strcmp(b->name, b->show)) ? b->show : ""); - mem = mem->next; - } - grp = g_slist_next(grp); - } - - while (len > pos && plist) { - pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); - plist = plist->next; - } - - while (len > pos && dlist) { - pos += g_snprintf(&s[pos], len - pos, "d %s\n", (char *)dlist->data); - dlist = dlist->next; - } } Index: dialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- dialogs.c 2001/09/28 01:25:02 1.252 +++ dialogs.c 2001/09/28 07:46:36 1.253 @@ -2781,122 +2781,46 @@ /* The dialog for import/export */ /*------------------------------------------------------------------------*/ -static gchar *get_screenname_filename(const char *name) -{ - gchar **split; - gchar *good; - int i; - - split = g_strsplit(name, G_DIR_SEPARATOR_S, -1); - good = g_strjoinv(NULL, split); - g_strfreev(split); - - for (i = 0; i < strlen(good); i++) - good[i] = toupper(good[i]); - - return good; -} - -/* see if a buddy list cache file for this user exists */ - -gboolean bud_list_cache_exists(struct gaim_connection *gc) +static void do_import_dialog(GtkWidget *w, struct gaim_connection *gc) { - gboolean ret = FALSE; - char path[PATHSIZE]; - char *file; - struct stat sbuf; - char *g_screenname; - - g_screenname = get_screenname_filename(gc->username); - - file = gaim_user_dir(); - if (file != (char *)NULL) { - g_snprintf(path, sizeof path, "%s/%s.%d.blist", file, g_screenname, - (gc->protocol == PROTO_OSCAR) ? PROTO_TOC : gc->protocol); - if (!stat(path, &sbuf)) { - debug_printf("%s exists.\n", path); - ret = TRUE; - } else { - char path2[PATHSIZE]; - debug_printf("%s does not exist.\n", path); - g_snprintf(path2, sizeof path2, "%s/%s.blist", file, g_screenname); - if (!stat(path2, &sbuf)) { - debug_printf("%s exists, moving to %s\n", path2, path); - if (rename(path2, path)) - debug_printf("rename didn't work!\n"); - else - ret = TRUE; - } - } - g_free(file); + char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); + if (file_is_dir(file, importdialog)) { + return; } - g_free(g_screenname); - return ret; + /* FIXME : import buddy list file. moderately important */ + do_import(connections->data, file); + destroy_dialog(NULL, importdialog); + importdialog = NULL; + do_export(connections->data); } -/* if dummy is 0, save to ~/.gaim/screenname.blist, where screenname is each - * signed in user. Else, let user choose */ - -void do_export(struct gaim_connection *g) +void show_import_dialog() { - FILE *dir; - FILE *f; - char buf[32 * 1024]; - char *file; - char path[PATHSIZE]; - char *g_screenname; + char *buf = g_malloc(BUF_LEN); + if (!importdialog) { + importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List")); - /* - if ( show_dialog == 1 ) { - file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog)); - strncpy( path, file, PATHSIZE - 1 ); - if (file_is_dir(path, exportdialog)) { - return; - } - if ((f = fopen(path,"w"))) { - toc_build_config(connections->data, buf, 8192 - 1, TRUE); - fprintf(f, "%s\n", buf); - fclose(f); - chmod(buf, S_IRUSR | S_IWUSR); - } else { - g_snprintf(buf, BUF_LONG / 2, _("Error writing file %s"), file); - do_error_dialog(buf, _("Error")); - } - destroy_dialog(NULL, exportdialog); - exportdialog = NULL; - } else { - */ + gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog)); - file = gaim_user_dir(); - if (!file) - return; + g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME")); - strcpy(buf, file); - dir = fopen(buf, "r"); - if (!dir) - mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); - else - fclose(dir); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf); + gtk_signal_connect(GTK_OBJECT(importdialog), "destroy", + GTK_SIGNAL_FUNC(destroy_dialog), importdialog); - g_screenname = get_screenname_filename(g->username); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button), + "clicked", GTK_SIGNAL_FUNC(do_import_dialog), NULL); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button), + "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog); - sprintf(path, "%s/%s.%d.blist", file, g_screenname, - (g->protocol == PROTO_OSCAR) ? PROTO_TOC : g->protocol); - if ((f = fopen(path, "w"))) { - debug_printf("writing %s\n", path); - toc_build_config(g, buf, 8192 - 1, TRUE); - fprintf(f, "%s\n", buf); - fclose(f); - chmod(buf, S_IRUSR | S_IWUSR); - } else { - debug_printf("unable to write %s\n", path); + } - g_free(g_screenname); - g_free(file); + g_free(buf); + gtk_widget_show(importdialog); + gdk_window_raise(importdialog->window); } - /* void show_export_dialog() { @@ -2927,157 +2851,6 @@ } */ - -/* if gc is non-NULL, then import from ~/.gaim/gc->username.blist, else let user - choose */ - -void do_import(GtkWidget *w, struct gaim_connection *gc) -{ - char *buf = g_malloc(BUF_LONG * 2); - char *buf2; - char *first = g_malloc(64); - char *file; - char path[PATHSIZE]; - char *g_screenname; - int len; - FILE *f; - gboolean from_dialog = FALSE; - - if (!gc) { - debug_printf("want to import file "); - file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); - debug_printf("%s", file); - if (file_is_dir(file, importdialog)) { - debug_printf(" but it is a directory\n"); - g_free(buf); - g_free(first); - return; - } - strncpy(path, file, PATHSIZE - 1); - /* FIXME : import buddy list file. moderately important */ - gc = connections->data; - from_dialog = TRUE; - } else { - g_screenname = get_screenname_filename(gc->username); - - file = gaim_user_dir(); - if (file != (char *)NULL) { - sprintf(path, "%s/%s.%d.blist", file, g_screenname, - (gc->protocol == PROTO_OSCAR) ? PROTO_TOC : gc->protocol); - g_free(file); - g_free(g_screenname); - } else { - g_free(g_screenname); - g_free(buf); - g_free(first); - return; - } - } - - if (!(f = fopen(path, "r"))) { - if (from_dialog) { - debug_printf(" but it can't be opened\n"); - g_snprintf(buf, BUF_LONG / 2, _("Error reading file %s"), path); - do_error_dialog(buf, _("Error")); - destroy_dialog(NULL, importdialog); - importdialog = NULL; - } - debug_printf("Unable to open %s.\n", path); - g_free(buf); - g_free(first); - return; - } - - fgets(first, 64, f); - - /* AIM 4 buddy list */ - if (!g_strncasecmp(first, "Config {", strlen("Config {"))) { - debug_printf("aim 4\n"); - rewind(f); - translate_blt(f, buf); - debug_printf("%s\n", buf); - buf2 = buf; - buf = g_malloc(8193); - g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); - g_free(buf2); - /* AIM 3 buddy list */ - } else if (strstr(first, "group") != NULL) { - debug_printf("aim 3\n"); - rewind(f); - translate_lst(f, buf); - debug_printf("%s\n", buf); - buf2 = buf; - buf = g_malloc(8193); - g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); - g_free(buf2); - /* GAIM buddy list - no translation */ - } else if (first[0] == 'm') { - rewind(f); - len = fread(buf, 1, BUF_LONG * 2, f); - buf[len] = '\0'; - buf2 = buf; - buf = g_malloc(8193); - g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); - g_free(buf2); - /* Something else */ - } else { - if (from_dialog) { - debug_printf(" but I don't recognize the format\n"); - destroy_dialog(NULL, importdialog); - importdialog = NULL; - } - g_free(buf); - g_free(first); - fclose(f); - return; - } - - if (from_dialog) - debug_printf("\n"); - - parse_toc_buddy_list(gc, buf, 1); - - fclose(f); - - if (from_dialog) { - /* save what we just did to cache */ - - do_export(gc); - destroy_dialog(NULL, importdialog); - importdialog = NULL; - } - - g_free(buf); - g_free(first); -} - -void show_import_dialog() -{ - char *buf = g_malloc(BUF_LEN); - if (!importdialog) { - importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List")); - - gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog)); - - g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME")); - - gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf); - gtk_signal_connect(GTK_OBJECT(importdialog), "destroy", - GTK_SIGNAL_FUNC(destroy_dialog), importdialog); - - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button), - "clicked", GTK_SIGNAL_FUNC(do_import), NULL); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button), - "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog); - - - } - - g_free(buf); - gtk_widget_show(importdialog); - gdk_window_raise(importdialog->window); -} - /*------------------------------------------------------------------------*/ /* The dialog for new away messages */ Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.268 retrieving revision 1.269 diff -u -d -r1.268 -r1.269 --- gaim.h 2001/09/28 05:17:16 1.268 +++ gaim.h 2001/09/28 07:46:36 1.269 @@ -631,8 +631,6 @@ extern char *away_subs(char *, char *); extern GtkWidget *picture_button(GtkWidget *, char *, char **); extern GtkWidget *picture_button2(GtkWidget *, char *, char **, short); -extern void translate_lst (FILE *, char *); -extern void translate_blt (FILE *, char *); extern char *stylize(gchar *, int); extern void show_usage (int, char *); extern int do_auto_login (char *); @@ -676,7 +674,6 @@ extern void serv_chat_leave(struct gaim_connection *, int); extern void serv_chat_whisper(struct gaim_connection *, int, char *, char *); extern int serv_chat_send(struct gaim_connection *, int, char *); -extern void update_keepalive(struct gaim_connection *, gboolean); /* output from serv */ extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); @@ -750,7 +747,6 @@ extern void signoff_all(gpointer, gpointer); extern void do_im_back(); extern void set_buddy(struct gaim_connection *, struct buddy *); -extern struct group *add_group(struct gaim_connection *, char *); extern void add_category(char *); extern void build_edit_tree(); extern void remove_person(struct group *, struct buddy *); @@ -761,8 +757,13 @@ extern struct group *find_group(struct gaim_connection *, char *); extern struct group *find_group_by_buddy(struct gaim_connection *, char *); extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); +extern void ui_remove_buddy(struct gaim_connection *, struct group *, struct buddy *); extern struct buddy *add_buddy(struct gaim_connection *, char *, char *, char *); +extern void ui_add_buddy(struct gaim_connection *, struct group *, struct buddy *); extern void remove_group(struct gaim_connection *, struct group *); +extern void ui_remove_group(struct gaim_connection *, struct group *); +extern struct group *add_group(struct gaim_connection *, char *); +extern void ui_add_group(struct gaim_connection *, struct group *); extern void toggle_buddy_pixmaps(); extern void gaim_separator(GtkWidget *); extern void redo_buddy_list(); /* you really shouldn't call this function */ @@ -867,7 +868,7 @@ extern void show_ee_dialog(int); extern void show_add_link(GtkWidget *,struct conversation *); extern void show_change_passwd(struct gaim_connection *); -extern void do_import(GtkWidget *, struct gaim_connection *); +extern void do_import(struct gaim_connection *, char *); extern int bud_list_cache_exists(struct gaim_connection *); extern void show_smiley_dialog(struct conversation *, GtkWidget *); extern void close_smiley_dialog(GtkWidget *widget, struct conversation *c); Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- multi.c 2001/09/28 02:16:34 1.80 +++ multi.c 2001/09/28 07:46:36 1.81 @@ -68,7 +68,7 @@ g_snprintf(gc->password, sizeof(gc->password), "%s", user->password); gc->options = user->options; gc->keepalive = 0; - gc->inpa = -1; + gc->inpa = 0; gc->buddy_chats = NULL; gc->groups = NULL; gc->permit = NULL; @@ -1099,7 +1099,6 @@ debug_printf("date: %s\n", full_date()); plugin_event(event_signoff, gc, 0, 0, 0); system_log(log_signoff, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); - update_keepalive(gc, FALSE); /* UI stuff */ convo_menu_remove(gc); Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.194 retrieving revision 1.195 diff -u -d -r1.194 -r1.195 --- server.c 2001/09/28 05:17:16 1.194 +++ server.c 2001/09/28 07:46:36 1.195 @@ -53,6 +53,26 @@ } } +static gboolean send_keepalive(gpointer d) +{ + struct gaim_connection *gc = d; + if (gc->prpl && gc->prpl->keepalive) + (*gc->prpl->keepalive)(gc); + return TRUE; +} + +static void update_keepalive(struct gaim_connection *gc, gboolean on) +{ + if (on && !gc->keepalive) { + debug_printf("allowing NOP\n"); + gc->keepalive = g_timeout_add(60000, send_keepalive, gc); + } else if (!on && gc->keepalive > 0) { + debug_printf("removing NOP\n"); + g_source_remove(gc->keepalive); + gc->keepalive = 0; + } +} + void serv_close(struct gaim_connection *gc) { while (gc->buddy_chats) { @@ -65,9 +85,7 @@ g_source_remove(gc->idle_timer); gc->idle_timer = 0; - if (gc->keepalive > 0) - g_source_remove(gc->keepalive); - gc->keepalive = 0; + update_keepalive(gc, FALSE); if (gc->prpl && gc->prpl->close) (*gc->prpl->close)(gc); @@ -913,23 +931,4 @@ chat_write(b, who, w, buf, mtime); g_free(buf); -} - -void send_keepalive(gpointer d) -{ - struct gaim_connection *gc = (struct gaim_connection *)d; - if (gc->prpl && gc->prpl->keepalive) - (*gc->prpl->keepalive)(gc); -} - -void update_keepalive(struct gaim_connection *gc, gboolean on) -{ - if (on && !gc->keepalive && blist) { - debug_printf("allowing NOP\n"); - gc->keepalive = g_timeout_add(60000, send_keepalive, gc); - } else if (!on && gc->keepalive > 0) { - debug_printf("removing NOP\n"); - g_source_remove(gc->keepalive); - gc->keepalive = 0; - } } Index: util.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/util.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- util.c 2001/09/28 01:25:02 1.105 +++ util.c 2001/09/28 07:46:36 1.106 @@ -716,135 +716,6 @@ return (cpy); } - - -/* remove leading whitespace from a string */ -char *remove_spaces(char *str) -{ - int i; - char *new; - - if (str == NULL) - return NULL; - - i = strspn(str, " \t\n\r\f"); - new = &str[i]; - - return new; -} - - -/* translate an AIM 3 buddylist (*.lst) to a GAIM buddylist */ -void translate_lst(FILE *src_fp, char *dest) -{ - char line[BUF_LEN], *line2; - char *name; - int i; - - sprintf(dest, "m 1\n"); - - while (fgets(line, BUF_LEN, src_fp)) { - line2 = remove_spaces(line); - if (strstr(line2, "group") == line2) { - name = strpbrk(line2, " \t\n\r\f") + 1; - strcat(dest, "g "); - for (i = 0; i < strcspn(name, "\n\r"); i++) - if (name[i] != '\"') - strncat(dest, &name[i], 1); - strcat(dest, "\n"); - } - if (strstr(line2, "buddy") == line2) { - name = strpbrk(line2, " \t\n\r\f") + 1; - strcat(dest, "b "); - for (i = 0; i < strcspn(name, "\n\r"); i++) - if (name[i] != '\"') - strncat(dest, &name[i], 1); - strcat(dest, "\n"); - } - } - - return; -} - - -/* translate an AIM 4 buddylist (*.blt) to GAIM format */ -void translate_blt(FILE *src_fp, char *dest) -{ - int i; - char line[BUF_LEN]; - char *buddy; - - sprintf(dest, "m 1\n"); - - while (strstr(fgets(line, BUF_LEN, src_fp), "Buddy") == NULL); - while (strstr(fgets(line, BUF_LEN, src_fp), "list") == NULL); - - while (1) { - fgets(line, BUF_LEN, src_fp); - if (strchr(line, '}') != NULL) - break; - - /* Syntax starting with "<group> {" */ - if (strchr(line, '{') != NULL) { - strcat(dest, "g "); - buddy = remove_spaces(strtok(line, "{")); - for (i = 0; i < strlen(buddy); i++) { - if (buddy[i] != '\"') - strncat(dest, &buddy[i], 1); - } - strcat(dest, "\n"); - while (strchr(fgets(line, BUF_LEN, src_fp), '}') == NULL) { - buddy = remove_spaces(line); - strcat(dest, "b "); - if (strchr(buddy, '\"') != NULL) { - buddy++; - strncat(dest, buddy, strchr(buddy, '\"') - buddy); - strcat(dest, "\n"); - } else - strcat(dest, buddy); - } - } - /* Syntax "group buddy buddy ..." */ - else { - buddy = remove_spaces(strtok(line, " \n")); - strcat(dest, "g "); - if (strchr(buddy, '\"') != NULL) { - strcat(dest, &buddy[1]); - strcat(dest, " "); - buddy = remove_spaces(strtok(NULL, " \n")); - while (strchr(buddy, '\"') == NULL) { - strcat(dest, buddy); - strcat(dest, " "); - buddy = remove_spaces(strtok(NULL, " \n")); - } - strncat(dest, buddy, strlen(buddy) - 1); - } else { - strcat(dest, buddy); - } - strcat(dest, "\n"); - while ((buddy = remove_spaces(strtok(NULL, " \n"))) != NULL) { - strcat(dest, "b "); - if (strchr(buddy, '\"') != NULL) { - strcat(dest, &buddy[1]); - strcat(dest, " "); - buddy = remove_spaces(strtok(NULL, " \n")); - while (strchr(buddy, '\"') == NULL) { - strcat(dest, buddy); - strcat(dest, " "); - buddy = remove_spaces(strtok(NULL, " \n")); - } - strncat(dest, buddy, strlen(buddy) - 1); - } else { - strcat(dest, buddy); - } - strcat(dest, "\n"); - } - } - } - - return; -} - char *stylize(gchar *text, int length) { gchar *buf; |
From: Eric W. <war...@us...> - 2001-09-28 07:46:39
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory usw-pr-cvs1:/tmp/cvs-serv11370/protocols/msn Modified Files: msn.c Log Message: big reorg of code. list.c contains 0 gtk. Index: msn.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/msn.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- msn.c 2001/09/19 18:33:18 1.20 +++ msn.c 2001/09/28 07:46:36 1.21 @@ -738,7 +738,7 @@ md->fl = g_slist_append(md->fl, b); } else if (!md->imported) { if (bud_list_cache_exists(gc)) - do_import(NULL, gc); + do_import(gc, NULL); md->imported = TRUE; while (md->fl) { struct msn_buddy *mb = md->fl->data; |