comparison plugins/icq/gaim_icq.c @ 1401:bf041349b11e

[gaim-migrate @ 1411] abliity to set accounts away independent of each other. also allows for all the other states (like in yahoo and icq). probably breaks MSN, so don't use it until rob fixes it. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 10 Jan 2001 22:15:24 +0000
parents 8331d967288e
children 65f4a0325022
comparison
equal deleted inserted replaced
1400:476b24cdfa32 1401:bf041349b11e
312 static void icq_rem_buddy(struct gaim_connection *gc, char *who) { 312 static void icq_rem_buddy(struct gaim_connection *gc, char *who) {
313 struct icq_data *id = (struct icq_data *)gc->proto_data; 313 struct icq_data *id = (struct icq_data *)gc->proto_data;
314 icq_ContactRemove(id->link, atol(who)); 314 icq_ContactRemove(id->link, atol(who));
315 } 315 }
316 316
317 static void icq_set_away(struct gaim_connection *gc, char *msg) { 317 static void icq_set_away(struct gaim_connection *gc, char *state, char *msg) {
318 struct icq_data *id = (struct icq_data *)gc->proto_data; 318 struct icq_data *id = (struct icq_data *)gc->proto_data;
319 319
320 if (msg && msg[0]) { 320 if (!strcmp(state, "Online"))
321 icq_ChangeStatus(id->link, STATUS_ONLINE);
322 else if (!strcmp(state, "Away"))
323 icq_ChangeStatus(id->link, STATUS_AWAY);
324 else if (!strcmp(state, "Do Not Disturb"))
325 icq_ChangeStatus(id->link, STATUS_DND);
326 else if (!strcmp(state, "Not Available"))
321 icq_ChangeStatus(id->link, STATUS_NA); 327 icq_ChangeStatus(id->link, STATUS_NA);
322 } else { 328 else if (!strcmp(state, "Occupied"))
323 icq_ChangeStatus(id->link, STATUS_ONLINE); 329 icq_ChangeStatus(id->link, STATUS_OCCUPIED);
324 } 330 else if (!strcmp(state, "Free For Chat"))
331 icq_ChangeStatus(id->link, STATUS_FREE_CHAT);
332 else if (!strcmp(state, "Invisible"))
333 icq_ChangeStatus(id->link, STATUS_INVISIBLE);
334 else if (!strcmp(state, GAIM_AWAY_CUSTOM))
335 /* we have to do this even though we don't have a custom state */
336 icq_ChangeStatus(id->link, STATUS_NA);
325 } 337 }
326 338
327 static char **icq_list_icon(int uc) { 339 static char **icq_list_icon(int uc) {
328 guint status; 340 guint status;
329 if (uc == UC_NORMAL) 341 if (uc == UC_NORMAL)
409 hbox = gtk_hbox_new(FALSE, 5); 421 hbox = gtk_hbox_new(FALSE, 5);
410 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 422 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
411 gtk_widget_show(hbox); 423 gtk_widget_show(hbox);
412 } 424 }
413 425
426 static GList *icq_away_states() {
427 GList *m = NULL;
428
429 m = g_list_append(m, "Online");
430 m = g_list_append(m, "Away");
431 m = g_list_append(m, "Do Not Disturb");
432 m = g_list_append(m, "Not Available");
433 m = g_list_append(m, "Occupied");
434 m = g_list_append(m, "Free For Chat");
435 m = g_list_append(m, "Invisible");
436 }
437
414 static void icq_init(struct prpl *ret) { 438 static void icq_init(struct prpl *ret) {
415 ret->protocol = PROTO_ICQ; 439 ret->protocol = PROTO_ICQ;
416 ret->name = icq_name; 440 ret->name = icq_name;
417 ret->list_icon = icq_list_icon; 441 ret->list_icon = icq_list_icon;
442 ret->away_states = icq_away_states;
418 ret->action_menu = icq_action_menu; 443 ret->action_menu = icq_action_menu;
419 ret->user_opts = icq_user_opts; 444 ret->user_opts = icq_user_opts;
420 ret->login = icq_login; 445 ret->login = icq_login;
421 ret->close = icq_close; 446 ret->close = icq_close;
422 ret->send_im = icq_send_msg; 447 ret->send_im = icq_send_msg;