comparison 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
comparison
equal deleted inserted replaced
2764:b8967c961056 2765:dfd9705bc750
37 buffer[strlen(buffer) - 1] = 0; 37 buffer[strlen(buffer) - 1] = 0;
38 debug_printf("read: %s\n", buffer); 38 debug_printf("read: %s\n", buffer);
39 command = getarg(buffer, 0, 0); 39 command = getarg(buffer, 0, 0);
40 if (!strncasecmp(command, "signon", 6)) { 40 if (!strncasecmp(command, "signon", 6)) {
41 struct aim_user *u = NULL; 41 struct aim_user *u = NULL;
42 GList *userlist = aim_users; 42 GSList *userlist = aim_users;
43 arg1 = getarg(buffer, 1, 1); 43 arg1 = getarg(buffer, 1, 1);
44 if(arg1) { 44 if (arg1) {
45 while(userlist) { 45 while (userlist) {
46 struct aim_user *current = userlist->data; 46 struct aim_user *current = userlist->data;
47 if(!strcmp(current->username, arg1)) { 47 if (!strcmp(current->username, arg1)) {
48 u = current; 48 u = current;
49 break; 49 break;
50 } 50 }
51 userlist = userlist->next; 51 userlist = userlist->next;
52 } 52 }
53 free(arg1); 53 free(arg1);
54 } 54 }
55 if(u) /* username found */ 55 if (u) /* username found */
56 serv_login(u); 56 serv_login(u);
57 } else if (!strncasecmp(command, "signoff", 7)) { 57 } else if (!strncasecmp(command, "signoff", 7)) {
58 struct gaim_connection *gc = NULL; 58 struct gaim_connection *gc = NULL;
59 GSList *c = connections;
59 arg1 = getarg(buffer, 1, 1); 60 arg1 = getarg(buffer, 1, 1);
60 if (arg1) { 61 while (c) {
61 gc = find_gaim_conn_by_name(arg1); 62 gc = c->data;
62 free(arg1); 63 if (!strcmp(gc->username, arg1)) {
64 break;
65 }
66 gc = NULL;
67 c = c->next;
63 } 68 }
64 if (gc) signoff(gc); 69 if (gc)
65 else signoff_all(NULL, NULL); 70 signoff(gc);
71 else if (!arg1)
72 signoff_all(NULL, NULL);
73 free(arg1);
66 } else if (!strncasecmp(command, "send", 4)) { 74 } else if (!strncasecmp(command, "send", 4)) {
67 struct conversation *c; 75 struct conversation *c;
68 arg1 = getarg(buffer, 1, 0); 76 arg1 = getarg(buffer, 1, 0);
69 arg2 = getarg(buffer, 2, 1); 77 arg2 = getarg(buffer, 2, 1);
70 c = find_conversation(arg1); 78 c = find_conversation(arg1);