Changes in protocols/yahoo/yahoo.c [d2cbe0a:e7f46c5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo.c
rd2cbe0a re7f46c5 64 64 }; 65 65 66 static char *yahoo_name() 67 { 68 return "Yahoo"; 69 } 70 71 static struct prpl *my_protocol = NULL; 66 72 static GSList *byahoo_inputs = NULL; 67 73 static int byahoo_chat_id = 0; … … 189 195 { 190 196 struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data; 191 197 192 198 gc->away = NULL; 193 194 if ( msg)199 200 if (msg) 195 201 { 196 202 yd->current_status = YAHOO_STATUS_CUSTOM; 197 203 gc->away = ""; 198 204 } 199 if( state)205 else if (state) 200 206 { 201 207 gc->away = ""; 202 if( g_strcasecmp( 208 if( g_strcasecmp(state, "Available" ) == 0 ) 203 209 { 204 210 yd->current_status = YAHOO_STATUS_AVAILABLE; … … 235 241 } 236 242 } 237 else if ( gc->is_idle )243 else if ( gc->is_idle ) 238 244 yd->current_status = YAHOO_STATUS_IDLE; 239 245 else 240 246 yd->current_status = YAHOO_STATUS_AVAILABLE; 241 247 242 if( yd->current_status == YAHOO_STATUS_INVISIBLE ) 243 yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL ); 244 else 245 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 248 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 246 249 } 247 250 … … 393 396 } 394 397 395 void byahoo_init( )396 { 397 struct prpl *ret = g_new0(struct prpl, 1);398 ret->name = "yahoo";398 void byahoo_init( struct prpl *ret ) 399 { 400 ret->protocol = PROTO_YAHOO; 401 ret->name = yahoo_name; 399 402 400 403 ret->login = byahoo_login; 401 404 ret->close = byahoo_close; 402 405 ret->send_im = byahoo_send_im; 406 ret->send_typing = byahoo_send_typing; 403 407 ret->get_info = byahoo_get_info; 404 408 ret->away_states = byahoo_away_states; … … 408 412 ret->remove_buddy = byahoo_remove_buddy; 409 413 ret->get_status_string = byahoo_get_status_string; 410 ret->send_typing = byahoo_send_typing;411 414 412 415 ret->chat_send = byahoo_chat_send; … … 416 419 ret->cmp_buddynames = g_strcasecmp; 417 420 418 register_protocol(ret);421 my_protocol = ret; 419 422 } 420 423 … … 430 433 yd = gc->proto_data; 431 434 432 if( !strcmp(gc->prpl->name, "yahoo")&& yd->y2_id == id )435 if( gc->protocol == PROTO_YAHOO && yd->y2_id == id ) 433 436 return( gc ); 434 437 }
Note: See TracChangeset
for help on using the changeset viewer.