Changes in protocols/yahoo/yahoo.c [dfbb056:be915f5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo.c
rdfbb056 rbe915f5 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 … … 198 200 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 199 201 200 ic->away = NULL; 201 202 if( state && msg && g_strcasecmp( state, msg ) != 0 ) 203 { 204 yd->current_status = YAHOO_STATUS_CUSTOM; 205 ic->away = ""; 206 } 207 else if( state ) 208 { 209 /* Set msg to NULL since (if it isn't NULL already) it's equal 210 to state. msg must be empty if we want to use an existing 211 away state. */ 212 msg = NULL; 213 214 ic->away = ""; 215 if( g_strcasecmp( state, "Available" ) == 0 ) 216 { 217 yd->current_status = YAHOO_STATUS_AVAILABLE; 218 ic->away = NULL; 219 } 220 else if( g_strcasecmp( state, "Be Right Back" ) == 0 ) 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 ) 221 207 yd->current_status = YAHOO_STATUS_BRB; 222 208 else if( g_strcasecmp( state, "Busy" ) == 0 ) … … 238 224 else if( g_strcasecmp( state, "Invisible" ) == 0 ) 239 225 yd->current_status = YAHOO_STATUS_INVISIBLE; 240 else if( g_strcasecmp( state, GAIM_AWAY_CUSTOM ) == 0 ) 241 { 242 yd->current_status = YAHOO_STATUS_AVAILABLE; 243 244 ic->away = NULL; 245 } 246 } 226 else 227 yd->current_status = YAHOO_STATUS_CUSTOM; 228 } 229 else if( state ) 230 yd->current_status = YAHOO_STATUS_CUSTOM; 247 231 else 248 232 yd->current_status = YAHOO_STATUS_AVAILABLE; 249 233 250 yahoo_set_away( yd->y2_id, yd->current_status, msg, ic->away != NULL? 2 : 0 );234 yahoo_set_away( yd->y2_id, yd->current_status, msg, state ? 2 : 0 ); 251 235 } 252 236 253 237 static GList *byahoo_away_states( struct im_connection *ic ) 254 238 { 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 ); 239 static GList *m = NULL; 240 241 if( m == NULL ) 242 { 243 m = g_list_append( m, "Be Right Back" ); 244 m = g_list_append( m, "Busy" ); 245 m = g_list_append( m, "Not At Home" ); 246 m = g_list_append( m, "Not At Desk" ); 247 m = g_list_append( m, "Not In Office" ); 248 m = g_list_append( m, "On Phone" ); 249 m = g_list_append( m, "On Vacation" ); 250 m = g_list_append( m, "Out To Lunch" ); 251 m = g_list_append( m, "Stepped Out" ); 252 m = g_list_append( m, "Invisible" ); 253 } 269 254 270 255 return m; … … 345 330 346 331 return c; 332 } 333 334 static void byahoo_auth_allow( struct im_connection *ic, const char *who ) 335 { 336 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 337 338 yahoo_accept_buddy_ymsg13( yd->y2_id, NULL, who ); 339 } 340 341 static void byahoo_auth_deny( struct im_connection *ic, const char *who ) 342 { 343 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 344 345 yahoo_reject_buddy_ymsg13( yd->y2_id, NULL, who, NULL ); 347 346 } 348 347 … … 372 371 ret->handle_cmp = g_strcasecmp; 373 372 373 ret->auth_allow = byahoo_auth_allow; 374 ret->auth_deny = byahoo_auth_deny; 375 374 376 register_protocol(ret); 375 377 } … … 451 453 struct byahoo_write_ready_data *d = data; 452 454 453 yahoo_write_ready( d->id, d->fd, d->data ); 454 455 return FALSE; 455 return yahoo_write_ready( d->id, d->fd, d->data ); 456 456 } 457 457 … … 665 665 666 666 imcb_error( ic, "%s", err ); 667 668 if( fatal )669 imc_logout( ic, TRUE );670 667 } 671 668 … … 793 790 { 794 791 struct byahoo_conf_invitation *inv = data; 795 796 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 797 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 792 struct groupchat *b; 793 794 for( b = inv->ic->groupchats; b; b = b->next ) 795 if( b == inv->c ) 796 break; 797 798 if( b != NULL ) 799 { 800 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 801 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 802 } 803 else 804 { 805 imcb_log( inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name ); 806 } 807 798 808 g_free( inv->name ); 799 809 g_free( inv ); … … 911 921 } 912 922 923 void ext_yahoo_contact_auth_request( int id, const char *myid, const char *who, const char *msg ) 924 { 925 struct im_connection *ic = byahoo_get_ic_by_id( id ); 926 927 imcb_ask_auth( ic, who, NULL ); 928 } 929 913 930 void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg ) 914 931 { 915 /* Groups schmoups. If I want to handle groups properly I can get the916 buddy data from some internal libyahoo2 structure. */917 imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL );932 struct im_connection *ic = byahoo_get_ic_by_id( id ); 933 934 imcb_add_buddy( ic, (char*) who, NULL ); 918 935 } 919 936
Note: See TracChangeset
for help on using the changeset viewer.