Mercurial > pidgin.yaz
diff plugins/filectl.c @ 2765:dfd9705bc750
[gaim-migrate @ 2778]
Ari Pollak's update (sans applet)
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 19 Nov 2001 12:35:51 +0000 |
parents | 9ab820049ede |
children | 0e082a9e4c32 |
line wrap: on
line diff
--- a/plugins/filectl.c Mon Nov 19 12:23:40 2001 +0000 +++ b/plugins/filectl.c Mon Nov 19 12:35:51 2001 +0000 @@ -39,12 +39,12 @@ command = getarg(buffer, 0, 0); if (!strncasecmp(command, "signon", 6)) { struct aim_user *u = NULL; - GList *userlist = aim_users; + GSList *userlist = aim_users; arg1 = getarg(buffer, 1, 1); - if(arg1) { - while(userlist) { + if (arg1) { + while (userlist) { struct aim_user *current = userlist->data; - if(!strcmp(current->username, arg1)) { + if (!strcmp(current->username, arg1)) { u = current; break; } @@ -52,17 +52,25 @@ } free(arg1); } - if(u) /* username found */ + if (u) /* username found */ serv_login(u); } else if (!strncasecmp(command, "signoff", 7)) { struct gaim_connection *gc = NULL; + GSList *c = connections; arg1 = getarg(buffer, 1, 1); - if (arg1) { - gc = find_gaim_conn_by_name(arg1); - free(arg1); + while (c) { + gc = c->data; + if (!strcmp(gc->username, arg1)) { + break; + } + gc = NULL; + c = c->next; } - if (gc) signoff(gc); - else signoff_all(NULL, NULL); + if (gc) + signoff(gc); + else if (!arg1) + signoff_all(NULL, NULL); + free(arg1); } else if (!strncasecmp(command, "send", 4)) { struct conversation *c; arg1 = getarg(buffer, 1, 0);