aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/yahoo/libyahoo2.c5
-rw-r--r--protocols/yahoo/yahoo.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c
index 20e284f7..721f4b7c 100644
--- a/protocols/yahoo/libyahoo2.c
+++ b/protocols/yahoo/libyahoo2.c
@@ -4086,9 +4086,6 @@ void yahoo_send_typing(int id, const char *from, const char *who, int typ)
yahoo_packet_free(pkt);
}
-/* TODO(wilmer): See if this this function still works since I got rid of a
- lot of things that seemed illogical. Some things may have
- been intentional. */
void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away)
{
struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
@@ -4117,7 +4114,7 @@ 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);
- yahoo_packet_hash(pkt, 19, msg);
+ 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);
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c
index 78a8eb8a..a47de966 100644
--- a/protocols/yahoo/yahoo.c
+++ b/protocols/yahoo/yahoo.c
@@ -199,8 +199,10 @@ static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )
{
struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
- if( state )
+ if( state && msg == NULL )
{
+ /* Use these states only if msg doesn't contain additional
+ info since away messages are only supported with CUSTOM. */
if( g_strcasecmp( state, "Be Right Back" ) == 0 )
yd->current_status = YAHOO_STATUS_BRB;
else if( g_strcasecmp( state, "Busy" ) == 0 )
@@ -224,6 +226,8 @@ static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )
else
yd->current_status = YAHOO_STATUS_CUSTOM;
}
+ else if( state )
+ yd->current_status = YAHOO_STATUS_CUSTOM;
else
yd->current_status = YAHOO_STATUS_AVAILABLE;
/a> 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294