Changeset c5bc47b for protocols/yahoo/yahoo.c
- Timestamp:
- 2009-10-17T17:24:52Z (15 years ago)
- Branches:
- master
- Children:
- c48a033
- Parents:
- 0c41177 (diff), 2e44b1f (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo.c
r0c41177 rc5bc47b 197 197 { 198 198 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 199 200 ic->away = NULL; 199 char *away; 200 201 away = NULL; 201 202 202 203 if( state && msg && g_strcasecmp( state, msg ) != 0 ) 203 204 { 204 205 yd->current_status = YAHOO_STATUS_CUSTOM; 205 ic->away = "";206 away = ""; 206 207 } 207 208 else if( state ) … … 212 213 msg = NULL; 213 214 214 ic->away = "";215 away = ""; 215 216 if( g_strcasecmp( state, "Available" ) == 0 ) 216 217 { 217 218 yd->current_status = YAHOO_STATUS_AVAILABLE; 218 ic->away = NULL;219 away = NULL; 219 220 } 220 221 else if( g_strcasecmp( state, "Be Right Back" ) == 0 ) … … 242 243 yd->current_status = YAHOO_STATUS_AVAILABLE; 243 244 244 ic->away = NULL;245 away = NULL; 245 246 } 246 247 } … … 248 249 yd->current_status = YAHOO_STATUS_AVAILABLE; 249 250 250 yahoo_set_away( yd->y2_id, yd->current_status, msg, ic->away != NULL ? 2 : 0 );251 yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL ? 2 : 0 ); 251 252 } 252 253 253 254 static GList *byahoo_away_states( struct im_connection *ic ) 254 255 { 255 GList *m = NULL; 256 257 m = g_list_append( m, "Available" ); 258 m = g_list_append( m, "Be Right Back" ); 259 m = g_list_append( m, "Busy" ); 260 m = g_list_append( m, "Not At Home" ); 261 m = g_list_append( m, "Not At Desk" ); 262 m = g_list_append( m, "Not In Office" ); 263 m = g_list_append( m, "On Phone" ); 264 m = g_list_append( m, "On Vacation" ); 265 m = g_list_append( m, "Out To Lunch" ); 266 m = g_list_append( m, "Stepped Out" ); 267 m = g_list_append( m, "Invisible" ); 268 m = g_list_append( m, GAIM_AWAY_CUSTOM ); 256 static GList *m = NULL; 257 258 if( m == NULL ) 259 { 260 m = g_list_append( m, "Available" ); 261 m = g_list_append( m, "Be Right Back" ); 262 m = g_list_append( m, "Busy" ); 263 m = g_list_append( m, "Not At Home" ); 264 m = g_list_append( m, "Not At Desk" ); 265 m = g_list_append( m, "Not In Office" ); 266 m = g_list_append( m, "On Phone" ); 267 m = g_list_append( m, "On Vacation" ); 268 m = g_list_append( m, "Out To Lunch" ); 269 m = g_list_append( m, "Stepped Out" ); 270 m = g_list_append( m, "Invisible" ); 271 m = g_list_append( m, GAIM_AWAY_CUSTOM ); 272 } 269 273 270 274 return m; … … 345 349 346 350 return c; 351 } 352 353 static void byahoo_auth_allow( struct im_connection *ic, const char *who ) 354 { 355 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 356 357 yahoo_accept_buddy_ymsg13( yd->y2_id, NULL, who ); 358 } 359 360 static void byahoo_auth_deny( struct im_connection *ic, const char *who ) 361 { 362 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 363 364 yahoo_reject_buddy_ymsg13( yd->y2_id, NULL, who, NULL ); 347 365 } 348 366 … … 372 390 ret->handle_cmp = g_strcasecmp; 373 391 392 ret->auth_allow = byahoo_auth_allow; 393 ret->auth_deny = byahoo_auth_deny; 394 374 395 register_protocol(ret); 375 396 } … … 451 472 struct byahoo_write_ready_data *d = data; 452 473 453 yahoo_write_ready( d->id, d->fd, d->data ); 454 455 return FALSE; 474 return yahoo_write_ready( d->id, d->fd, d->data ); 456 475 } 457 476 … … 790 809 { 791 810 struct byahoo_conf_invitation *inv = data; 792 793 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 794 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 811 struct groupchat *b; 812 813 for( b = inv->ic->groupchats; b; b = b->next ) 814 if( b == inv->c ) 815 break; 816 817 if( b != NULL ) 818 { 819 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 820 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 821 } 822 else 823 { 824 imcb_log( inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name ); 825 } 826 795 827 g_free( inv->name ); 796 828 g_free( inv ); … … 908 940 } 909 941 942 void ext_yahoo_contact_auth_request( int id, const char *myid, const char *who, const char *msg ) 943 { 944 struct im_connection *ic = byahoo_get_ic_by_id( id ); 945 946 imcb_ask_auth( ic, who, NULL ); 947 } 948 910 949 void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg ) 911 950 { 912 /* Groups schmoups. If I want to handle groups properly I can get the913 buddy data from some internal libyahoo2 structure. */914 imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL );951 struct im_connection *ic = byahoo_get_ic_by_id( id ); 952 953 imcb_add_buddy( ic, (char*) who, NULL ); 915 954 } 916 955
Note: See TracChangeset
for help on using the changeset viewer.