- Timestamp:
- 2010-03-06T17:10:32Z (15 years ago)
- Branches:
- master
- Children:
- 0714d51
- Parents:
- 17f9522
- Location:
- protocols/yahoo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/libyahoo2.c
r17f9522 r4049061 4087 4087 } 4088 4088 4089 /* TODO(wilmer): See if this this function still works since I got rid of a 4090 lot of things that seemed illogical. Some things may have 4091 been intentional. */ 4089 4092 void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away) 4090 4093 { … … 4099 4102 4100 4103 yd = yid->yd; 4101 4102 4104 old_status = yd->current_status; 4103 4104 if (msg && strncmp(msg,"Invisible",9)) { 4105 yd->current_status = YAHOO_STATUS_CUSTOM; 4106 } else { 4107 yd->current_status = state; 4108 } 4105 yd->current_status = state; 4109 4106 4110 4107 /* Thank you libpurple :) */ … … 4121 4118 snprintf(s, sizeof(s), "%d", yd->current_status); 4122 4119 yahoo_packet_hash(pkt, 10, s); 4123 4124 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4125 yahoo_packet_hash(pkt, 19, msg); 4126 } else { 4127 yahoo_packet_hash(pkt, 19, ""); 4128 } 4129 4120 yahoo_packet_hash(pkt, 19, msg); 4130 4121 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 4131 4132 4122 yahoo_send_packet(yid, pkt, 0); 4133 4123 yahoo_packet_free(pkt); -
protocols/yahoo/yahoo.c
r17f9522 r4049061 130 130 { 131 131 set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 132 133 acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE; 132 134 } 133 135 … … 197 199 { 198 200 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 199 char *away; 200 201 away = NULL; 202 203 if( state && msg && g_strcasecmp( state, msg ) != 0 ) 204 { 205 yd->current_status = YAHOO_STATUS_CUSTOM; 206 away = ""; 207 } 208 else if( state ) 209 { 210 /* Set msg to NULL since (if it isn't NULL already) it's equal 211 to state. msg must be empty if we want to use an existing 212 away state. */ 213 msg = NULL; 214 215 away = ""; 216 if( g_strcasecmp( state, "Available" ) == 0 ) 217 { 218 yd->current_status = YAHOO_STATUS_AVAILABLE; 219 away = NULL; 220 } 221 else if( g_strcasecmp( state, "Be Right Back" ) == 0 ) 201 202 if( state ) 203 { 204 if( g_strcasecmp( state, "Be Right Back" ) == 0 ) 222 205 yd->current_status = YAHOO_STATUS_BRB; 223 206 else if( g_strcasecmp( state, "Busy" ) == 0 ) … … 239 222 else if( g_strcasecmp( state, "Invisible" ) == 0 ) 240 223 yd->current_status = YAHOO_STATUS_INVISIBLE; 241 else if( g_strcasecmp( state, GAIM_AWAY_CUSTOM ) == 0 ) 242 { 243 yd->current_status = YAHOO_STATUS_AVAILABLE; 244 245 away = NULL; 246 } 224 else 225 yd->current_status = YAHOO_STATUS_CUSTOM; 247 226 } 248 227 else 249 228 yd->current_status = YAHOO_STATUS_AVAILABLE; 250 229 251 yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL? 2 : 0 );230 yahoo_set_away( yd->y2_id, yd->current_status, msg, state ? 2 : 0 ); 252 231 } 253 232 … … 258 237 if( m == NULL ) 259 238 { 260 m = g_list_append( m, "Available" );261 239 m = g_list_append( m, "Be Right Back" ); 262 240 m = g_list_append( m, "Busy" ); … … 269 247 m = g_list_append( m, "Stepped Out" ); 270 248 m = g_list_append( m, "Invisible" ); 271 m = g_list_append( m, GAIM_AWAY_CUSTOM );272 249 } 273 250
Note: See TracChangeset
for help on using the changeset viewer.