comparison src/protocols/yahoo/yahoo.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 133cf6424c53
children 474265997752
comparison
equal deleted inserted replaced
4110:64d983d6b7bb 4111:ee884f1d7ae3
1184 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; 1184 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
1185 struct yahoo_packet *pkt; 1185 struct yahoo_packet *pkt;
1186 int service; 1186 int service;
1187 char s[4]; 1187 char s[4];
1188 1188
1189 gc->away = NULL; 1189 if (gc->away) {
1190 g_free(gc->away);
1191 gc->away = NULL;
1192 }
1190 1193
1191 if (msg) { 1194 if (msg) {
1192 yd->current_status = YAHOO_STATUS_CUSTOM; 1195 yd->current_status = YAHOO_STATUS_CUSTOM;
1193 gc->away = ""; 1196 gc->away = g_strdup(msg);
1194 } else if (state) { 1197 } else if (state) {
1195 gc->away = ""; 1198 gc->away = g_strdup("");
1196 if (!strcmp(state, "Available")) { 1199 if (!strcmp(state, "Available")) {
1197 yd->current_status = YAHOO_STATUS_AVAILABLE; 1200 yd->current_status = YAHOO_STATUS_AVAILABLE;
1201 g_free(gc->away);
1198 gc->away = NULL; 1202 gc->away = NULL;
1199 } else if (!strcmp(state, "Be Right Back")) { 1203 } else if (!strcmp(state, "Be Right Back")) {
1200 yd->current_status = YAHOO_STATUS_BRB; 1204 yd->current_status = YAHOO_STATUS_BRB;
1201 } else if (!strcmp(state, "Busy")) { 1205 } else if (!strcmp(state, "Busy")) {
1202 yd->current_status = YAHOO_STATUS_BUSY; 1206 yd->current_status = YAHOO_STATUS_BUSY;
1220 if (gc->is_idle) { 1224 if (gc->is_idle) {
1221 yd->current_status = YAHOO_STATUS_IDLE; 1225 yd->current_status = YAHOO_STATUS_IDLE;
1222 } else { 1226 } else {
1223 yd->current_status = YAHOO_STATUS_AVAILABLE; 1227 yd->current_status = YAHOO_STATUS_AVAILABLE;
1224 } 1228 }
1229 g_free(gc->away);
1225 gc->away = NULL; 1230 gc->away = NULL;
1226 } 1231 }
1227 } else if (gc->is_idle) { 1232 } else if (gc->is_idle) {
1228 yd->current_status = YAHOO_STATUS_IDLE; 1233 yd->current_status = YAHOO_STATUS_IDLE;
1229 } else { 1234 } else {