Mercurial > pidgin
comparison src/protocols/icq/gaim_icq.c @ 4111:ee884f1d7ae3
[gaim-migrate @ 4326]
<Robot101> adds a gc->flag called OPT_CONN_AUTO_RESP so that
gc->away can always store the away message even if
the prpl doesn't support autoresponding
<Robot101> makes all protos correctly free and set gc->away to
avoid leaks
<Robot101> stores the current away state in gc->away_state
whenever gc->away is non-NULL (ie it's not just a
plain on-line)
<Robot101> also minor change to Jabber to make Chatty an away
state, and to Gadu-Gadu to make some other thing an
away state too
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 21 Dec 2002 19:33:54 +0000 |
parents | 43e396e94095 |
children | 474265997752 |
comparison
equal
deleted
inserted
replaced
4110:64d983d6b7bb | 4111:ee884f1d7ae3 |
---|---|
395 } | 395 } |
396 | 396 |
397 static void icq_set_away(struct gaim_connection *gc, char *state, char *msg) { | 397 static void icq_set_away(struct gaim_connection *gc, char *state, char *msg) { |
398 struct icq_data *id = (struct icq_data *)gc->proto_data; | 398 struct icq_data *id = (struct icq_data *)gc->proto_data; |
399 | 399 |
400 if (gc->away) | 400 if (gc->away) { |
401 g_free(gc->away); | |
401 gc->away = NULL; | 402 gc->away = NULL; |
403 } | |
402 | 404 |
403 if (!strcmp(state, "Online")) | 405 if (!strcmp(state, "Online")) |
404 icq_ChangeStatus(id->link, STATUS_ONLINE); | 406 icq_ChangeStatus(id->link, STATUS_ONLINE); |
405 else if (!strcmp(state, "Away")) { | 407 else if (!strcmp(state, "Away")) { |
406 icq_ChangeStatus(id->link, STATUS_AWAY); | 408 icq_ChangeStatus(id->link, STATUS_AWAY); |
407 gc->away = ""; | 409 gc->away = g_strdup(""); |
408 } else if (!strcmp(state, "Do Not Disturb")) { | 410 } else if (!strcmp(state, "Do Not Disturb")) { |
409 icq_ChangeStatus(id->link, STATUS_DND); | 411 icq_ChangeStatus(id->link, STATUS_DND); |
410 gc->away = ""; | 412 gc->away = g_strdup(""); |
411 } else if (!strcmp(state, "Not Available")) { | 413 } else if (!strcmp(state, "Not Available")) { |
412 icq_ChangeStatus(id->link, STATUS_NA); | 414 icq_ChangeStatus(id->link, STATUS_NA); |
413 gc->away = ""; | 415 gc->away = g_strdup(""); |
414 } else if (!strcmp(state, "Occupied")) { | 416 } else if (!strcmp(state, "Occupied")) { |
415 icq_ChangeStatus(id->link, STATUS_OCCUPIED); | 417 icq_ChangeStatus(id->link, STATUS_OCCUPIED); |
416 gc->away = ""; | 418 gc->away = g_strdup(""); |
417 } else if (!strcmp(state, "Free For Chat")) { | 419 } else if (!strcmp(state, "Free For Chat")) { |
418 icq_ChangeStatus(id->link, STATUS_FREE_CHAT); | 420 icq_ChangeStatus(id->link, STATUS_FREE_CHAT); |
419 gc->away = ""; | 421 gc->away = g_strdup(""); |
420 } else if (!strcmp(state, "Invisible")) { | 422 } else if (!strcmp(state, "Invisible")) { |
421 icq_ChangeStatus(id->link, STATUS_INVISIBLE); | 423 icq_ChangeStatus(id->link, STATUS_INVISIBLE); |
422 gc->away = ""; | 424 gc->away = g_strdup(""); |
423 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { | 425 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { |
424 if (msg) { | 426 if (msg) { |
425 icq_ChangeStatus(id->link, STATUS_NA); | 427 icq_ChangeStatus(id->link, STATUS_NA); |
426 gc->away = ""; | 428 gc->away = g_strdup(""); |
427 } else { | 429 } else { |
428 icq_ChangeStatus(id->link, STATUS_ONLINE); | 430 icq_ChangeStatus(id->link, STATUS_ONLINE); |
429 } | 431 } |
430 } | 432 } |
431 } | 433 } |