Mercurial > pidgin.yaz
changeset 1344:8b5ed2f0496c
[gaim-migrate @ 1354]
jabber stuff.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 21 Dec 2000 10:31:42 +0000 |
parents | a0d89bdc733e |
children | d6e6fcaa1f39 |
files | pixmaps/Makefile.am pixmaps/available.xpm plugins/jabber/jabber.c src/dialogs.c |
diffstat | 4 files changed, 63 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/pixmaps/Makefile.am Thu Dec 21 06:56:48 2000 +0000 +++ b/pixmaps/Makefile.am Thu Dec 21 10:31:42 2000 +0000 @@ -6,6 +6,7 @@ aimicon2.xpm \ angel.xpm \ aol_icon.xpm \ + available.xpm \ away.xpm \ away_icon.xpm \ away_small.xpm \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixmaps/available.xpm Thu Dec 21 10:31:42 2000 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static char * available_xpm[] = { +"15 15 5 1", +" c None", +". c #333333", +"+ c #FFFF00", +"@ c #000000", +"# c #4C4C4C", +" ", +" ... ", +" .+++. ", +" .+++++. ", +" .+++++++. ", +" .++@+@++. ", +" .++@+@++. ", +" .+++@+++. ", +" .++@++. ", +" .++@++. ", +" .+++. ", +" #@@@# ", +" #@@@# ", +" @@@ ", +" "};
--- a/plugins/jabber/jabber.c Thu Dec 21 06:56:48 2000 +0000 +++ b/plugins/jabber/jabber.c Thu Dec 21 10:31:42 2000 +0000 @@ -49,6 +49,8 @@ #include "gaim.h" #include <jabber/jabber.h> +#include "pixmaps/available.xpm" + /* The priv member of gjconn's is a gaim_connection for now. */ #define GJ_GC(x) ((struct gaim_connection *)(x)->priv) @@ -439,8 +441,10 @@ debug_printf("jabber: presence: %s, %s %s\n", to, from, type); - if (!(b = find_buddy(GJ_GC(j), from))) - add_buddy(GJ_GC(j), "Extra", from, from); + if (!(b = find_buddy(GJ_GC(j), from))) { + add_buddy(GJ_GC(j), "Buddies", from, from); + do_export(NULL, NULL); + } if (type && (strcasecmp(type, "unavailable") == 0)) serv_got_update(GJ_GC(j), from, 0, 0, 0, 0, 0, 0); @@ -481,6 +485,7 @@ if (!(b = find_buddy(GJ_GC(j), jid))) { debug_printf("adding buddy: %s\n", jid); b = add_buddy(GJ_GC(j), groupname, jid, name?name:jid); + do_export(0, 0); } else { debug_printf("updating buddy: %s/%s\n", jid, name); g_snprintf(b->name, sizeof(b->name), "%s", jid); @@ -493,7 +498,8 @@ } else { struct buddy *b; if (!(b = find_buddy(GJ_GC(j), jid))) { - b = add_buddy(GJ_GC(j), "Extra", jid, name?name:jid); + b = add_buddy(GJ_GC(j), "Buddies", jid, name?name:jid); + do_export(0, 0); } } @@ -523,7 +529,6 @@ querynode = xmlnode_get_tag(p->x, "query"); xmlns = xmlnode_get_attrib(querynode, "xmlns"); - /* XXX this just doesn't look right */ if (!xmlns || NSCHECK(querynode, NS_AUTH)) { debug_printf("auth success\n"); @@ -578,11 +583,11 @@ break; case JCONN_STATE_CONNECTED: debug_printf("jabber: connected.\n"); - set_login_progress(GJ_GC(j), 1, "Connected"); + set_login_progress(GJ_GC(j), 3, "Connected"); break; case JCONN_STATE_ON: debug_printf("jabber: logging in...\n"); - set_login_progress(GJ_GC(j), 1, "Logging in..."); + set_login_progress(GJ_GC(j), 5, "Logging in..."); gjab_auth(j); break; default: @@ -596,14 +601,11 @@ struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1); set_login_progress(gc, 1, "Connecting"); - while (gtk_events_pending()) - gtk_main_iteration(); if (!(jd->jc = gjab_new(user->username, user->password, gc))) { debug_printf("jabber: unable to connect (jab_new failed)\n"); hide_login_progress(gc, "Unable to connect"); signoff(gc); - g_free(jd); return; }
--- a/src/dialogs.c Thu Dec 21 06:56:48 2000 +0000 +++ b/src/dialogs.c Thu Dec 21 10:31:42 2000 +0000 @@ -2750,6 +2750,22 @@ /* 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 @@ -2759,12 +2775,10 @@ char path[PATHSIZE]; char *file; struct stat sbuf; - char g_screenname[64]; + char *g_screenname; int i; - for (i = 0; i < strlen(gc->username); i++) - g_screenname[i] = toupper(gc->username[i]); - g_screenname[i] = '\0'; + g_screenname = get_screenname_filename(gc->username); file = gaim_user_dir(); if ( file != (char *) NULL ) { @@ -2787,6 +2801,7 @@ } g_free(file); } + g_free(g_screenname); return ret; } @@ -2822,7 +2837,7 @@ } else { GSList *c = connections; struct gaim_connection *g; - char g_screenname[64]; + char *g_screenname; int i; file = gaim_user_dir(); @@ -2838,9 +2853,8 @@ while (c) { g = (struct gaim_connection *)c->data; - for (i = 0; i < strlen(g->username); i++) - g_screenname[i] = toupper(g->username[i]); - g_screenname[i] = '\0'; + 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"))) { @@ -2853,6 +2867,8 @@ debug_printf("unable to write %s\n", path); } + g_free(g_screenname); + c = c->next; } g_free(file); @@ -2903,7 +2919,7 @@ char *first = g_malloc(64); char *file; char path[PATHSIZE]; - char g_screenname[64]; + char *g_screenname; int i; FILE *f; gboolean from_dialog = FALSE; @@ -2920,16 +2936,16 @@ gc = connections->data; from_dialog = TRUE; } else { - for (i = 0; i < strlen(gc->username); i++) - g_screenname[i] = toupper(gc->username[i]); - g_screenname[i] = '\0'; + 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); return; } }