Changeset fb020ac for protocols/yahoo
- Timestamp:
- 2010-03-07T18:43:23Z (15 years ago)
- Branches:
- master
- Children:
- 279607e
- Parents:
- e08e53c (diff), c32f492 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols/yahoo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/libyahoo2.c
re08e53c rfb020ac 1530 1530 newbud = y_new0(struct yahoo_buddy, 1); 1531 1531 newbud->id = strdup(pair->value); 1532 if (cur_group)1532 if (cur_group) { 1533 1533 newbud->group = strdup(cur_group); 1534 else { 1535 struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth( 1536 yd->buddies, y_list_length(yd->buddies)-1)->data; 1537 newbud->group = strdup(lastbud->group); 1534 } else { 1535 YList *last; 1536 struct yahoo_buddy *lastbud; 1537 1538 for (last = yd->buddies; last && last->next; last = last->next); 1539 if (last) { 1540 lastbud = last->data; 1541 newbud->group = strdup(lastbud->group); 1542 } else { 1543 newbud->group = strdup("Buddies"); 1544 } 1538 1545 } 1539 1546 … … 2393 2400 { 2394 2401 struct yahoo_https_auth_data *had = req->data; 2395 struct yahoo_input_data *yid = had->yid;2396 struct yahoo_data *yd = yid->yd;2402 struct yahoo_input_data *yid; 2403 struct yahoo_data *yd; 2397 2404 int st; 2405 2406 if (y_list_find(inputs, had->yid) == NULL) 2407 return; 2408 2409 yid = had->yid; 2410 yd = yid->yd; 2398 2411 2399 2412 if (req->status_code != 200) { … … 2436 2449 { 2437 2450 struct yahoo_https_auth_data *had = req->data; 2438 struct yahoo_input_data *yid = had->yid;2439 struct yahoo_data *yd = yid->yd;2451 struct yahoo_input_data *yid; 2452 struct yahoo_data *yd; 2440 2453 struct yahoo_packet *pack; 2441 char *crumb ;2454 char *crumb = NULL; 2442 2455 int st; 2456 2457 if (y_list_find(inputs, had->yid) == NULL) 2458 return; 2459 2460 yid = had->yid; 2461 yd = yid->yd; 2443 2462 2444 2463 md5_byte_t result[16]; … … 4080 4099 4081 4100 yd = yid->yd; 4082 4083 4101 old_status = yd->current_status; 4084 4085 if (msg && strncmp(msg,"Invisible",9)) { 4086 yd->current_status = YAHOO_STATUS_CUSTOM; 4087 } else { 4088 yd->current_status = state; 4089 } 4102 yd->current_status = state; 4090 4103 4091 4104 /* Thank you libpurple :) */ … … 4102 4115 snprintf(s, sizeof(s), "%d", yd->current_status); 4103 4116 yahoo_packet_hash(pkt, 10, s); 4104 4105 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4106 yahoo_packet_hash(pkt, 19, msg); 4107 } else { 4108 yahoo_packet_hash(pkt, 19, ""); 4109 } 4110 4117 yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : ""); 4111 4118 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 4112 4113 4119 yahoo_send_packet(yid, pkt, 0); 4114 4120 yahoo_packet_free(pkt); -
protocols/yahoo/yahoo.c
re08e53c rfb020ac 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 && msg == NULL ) 203 { 204 /* Use these states only if msg doesn't contain additional 205 info since away messages are only supported with CUSTOM. */ 206 if( g_strcasecmp( state, "Be Right Back" ) == 0 ) 222 207 yd->current_status = YAHOO_STATUS_BRB; 223 208 else if( g_strcasecmp( state, "Busy" ) == 0 ) … … 239 224 else if( g_strcasecmp( state, "Invisible" ) == 0 ) 240 225 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 } 247 } 226 else 227 yd->current_status = YAHOO_STATUS_CUSTOM; 228 } 229 else if( state ) 230 yd->current_status = YAHOO_STATUS_CUSTOM; 248 231 else 249 232 yd->current_status = YAHOO_STATUS_AVAILABLE; 250 233 251 yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL? 2 : 0 );234 yahoo_set_away( yd->y2_id, yd->current_status, msg, state ? 2 : 0 ); 252 235 } 253 236 … … 258 241 if( m == NULL ) 259 242 { 260 m = g_list_append( m, "Available" );261 243 m = g_list_append( m, "Be Right Back" ); 262 244 m = g_list_append( m, "Busy" ); … … 269 251 m = g_list_append( m, "Stepped Out" ); 270 252 m = g_list_append( m, "Invisible" ); 271 m = g_list_append( m, GAIM_AWAY_CUSTOM );272 253 } 273 254
Note: See TracChangeset
for help on using the changeset viewer.