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