diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-07 18:41:45 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-07 18:41:45 +0000 |
commit | c32f492758759c04d8b6239a7862648c9d32c4d8 (patch) | |
tree | 628612ec0d2c431519a0a3741df7e4c6609db7f1 /protocols/yahoo/libyahoo2.c | |
parent | 1c2eaa3c99a2e7fbe264b06e559f3d709b9a080d (diff) | |
parent | 0e99548ba9c6ec9c78367e05b676dab90b5261a4 (diff) |
Merging in improved away/status message code.
Diffstat (limited to 'protocols/yahoo/libyahoo2.c')
-rw-r--r-- | protocols/yahoo/libyahoo2.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 836670f7..721f4b7c 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -4098,14 +4098,8 @@ void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away) return; yd = yid->yd; - old_status = yd->current_status; - - if (msg && strncmp(msg,"Invisible",9)) { - yd->current_status = YAHOO_STATUS_CUSTOM; - } else { - yd->current_status = state; - } + yd->current_status = state; /* Thank you libpurple :) */ if (yd->current_status == YAHOO_STATUS_INVISIBLE) { @@ -4120,15 +4114,8 @@ void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away) pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, yd->current_status, yd->session_id); snprintf(s, sizeof(s), "%d", yd->current_status); yahoo_packet_hash(pkt, 10, s); - - if (yd->current_status == YAHOO_STATUS_CUSTOM) { - yahoo_packet_hash(pkt, 19, msg); - } else { - yahoo_packet_hash(pkt, 19, ""); - } - + yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : ""); yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); - yahoo_send_packet(yid, pkt, 0); yahoo_packet_free(pkt); |