comparison libpurple/protocols/mxit/mxit.c @ 31951:a769e6da0a8e

The mini-dialogs feature now allows you to request profile information for pending invites before accepting them. Since it's an invite there is no PurpleBuddy associated with the user, and therefore we cannot perform the contact-type check. So just skip the check if we cannot find the buddy.
author andrew.victor@mxit.com
date Thu, 31 Mar 2011 20:15:18 +0000
parents ff2a8a839dbd
children 2e4ac25df4ba
comparison
equal deleted inserted replaced
31950:9e9abd65b840 31951:a769e6da0a8e
569 569
570 purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_info: '%s'\n", who ); 570 purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_info: '%s'\n", who );
571 571
572 /* find the buddy information for this contact (reference: "libpurple/blist.h") */ 572 /* find the buddy information for this contact (reference: "libpurple/blist.h") */
573 buddy = purple_find_buddy( session->acc, who ); 573 buddy = purple_find_buddy( session->acc, who );
574 if ( !buddy ) { 574 if ( buddy ) {
575 purple_debug_warning( MXIT_PLUGIN_ID, "mxit_get_info: unable to find the buddy '%s'\n", who ); 575 /* user is in our contact-list, so it's not an invite */
576 return; 576 contact = purple_buddy_get_protocol_data( buddy );
577 } 577 if ( !contact )
578 578 return;
579 contact = purple_buddy_get_protocol_data( buddy ); 579
580 if ( !contact ) 580 /* only MXit users have profiles */
581 return; 581 if ( contact->type != MXIT_TYPE_MXIT ) {
582 582 mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "No profile available" ), _( "This contact does not have a profile." ) );
583 /* only MXit users have profiles */ 583 return;
584 if ( contact->type != MXIT_TYPE_MXIT ) { 584 }
585 mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "No profile available" ), _( "This contact does not have a profile." ) );
586 return;
587 } 585 }
588 586
589 /* send profile request */ 587 /* send profile request */
590 mxit_send_extprofile_request( session, who, ARRAY_SIZE( profilelist ), profilelist ); 588 mxit_send_extprofile_request( session, who, ARRAY_SIZE( profilelist ), profilelist );
591 } 589 }