# HG changeset patch # User andrew.victor@mxit.com # Date 1304863564 0 # Node ID dff70c2930e8411c167c0cfdbc1d1218333d4438 # Parent a8cf2003ee7c70b6b7c23e33b00f996360590e02# Parent dd83aa0bc5c0ca7887a0eca9fe681bff0ef1cb97 propagate from branch 'im.pidgin.pidgin' (head d6053150b258c5c8b2ac60e091a7d0d1b2d9be1d) to branch 'im.pidgin.pidgin.mxit' (head 15f4e610ac107f652c16aef6c2f7c2ecbe739a8c) diff -r dd83aa0bc5c0 -r dff70c2930e8 ChangeLog --- a/ChangeLog Sat May 07 22:20:09 2011 +0000 +++ b/ChangeLog Sun May 08 14:06:04 2011 +0000 @@ -86,6 +86,10 @@ * The Change PIN option was moved into separate action. * New profile attributes added and shown. * Update to protocol v6.3. + * Added the ability to view and invite your Suggested Friends, + and to search for contacts. + * Also display the Status Message of offline contacts in their + profile information. XMPP: * Remember the previously entered user directory when searching. diff -r dd83aa0bc5c0 -r dff70c2930e8 libpurple/protocols/mxit/profile.c --- a/libpurple/protocols/mxit/profile.c Sat May 07 22:20:09 2011 +0000 +++ b/libpurple/protocols/mxit/profile.c Sun May 08 14:06:04 2011 +0000 @@ -292,9 +292,10 @@ while (entries != NULL) { struct MXitProfile* profile = ( struct MXitProfile *) entries->data; GList* row; + gchar* tmp = purple_base64_encode( (unsigned char *) profile->userid, strlen( profile->userid ) ); /* column values */ - row = g_list_append( NULL, g_strdup( profile->userid ) ); + row = g_list_append( NULL, g_strdup_printf( "#%s", tmp ) ); row = g_list_append( row, g_strdup( profile->nickname ) ); row = g_list_append( row, g_strdup( profile->male ? "Male" : "Female" ) ); row = g_list_append( row, g_strdup_printf( "%i", calculateAge( profile->birthday ) ) ); @@ -302,6 +303,8 @@ purple_notify_searchresults_row_add( results, row ); entries = g_list_next( entries ); + + g_free( tmp ); } /* button */ diff -r dd83aa0bc5c0 -r dff70c2930e8 libpurple/protocols/mxit/protocol.c --- a/libpurple/protocols/mxit/protocol.c Sat May 07 22:20:09 2011 +0000 +++ b/libpurple/protocols/mxit/protocol.c Sun May 08 14:06:04 2011 +0000 @@ -1907,6 +1907,23 @@ /* this is a contact */ if ( avatarId ) mxit_update_buddy_avatar( session, mxitId, avatarId ); + + if ( ( statusMsg ) && ( strlen( statusMsg ) > 0 ) ) { + /* update the status message */ + PurpleBuddy* buddy = NULL; + + buddy = purple_find_buddy( session->acc, mxitId ); + if ( buddy ) { + contact = purple_buddy_get_protocol_data( buddy ); + if ( contact ) { + if ( contact->statusMsg ) + g_free( contact->statusMsg ); + contact->statusMsg = strdup( statusMsg ); + } + } + } + + /* show the profile */ mxit_show_profile( session, mxitId, profile ); g_free( profile ); } @@ -2099,6 +2116,7 @@ if ( contact ) { /* this is an invite (add image to the internal image store) */ contact->imgid = purple_imgstore_add_with_id( chunk.data, chunk.length, NULL ); + /* show the profile */ mxit_show_profile( session, chunk.mxitid, contact->profile ); } else { diff -r dd83aa0bc5c0 -r dff70c2930e8 libpurple/protocols/mxit/roster.c --- a/libpurple/protocols/mxit/roster.c Sat May 07 22:20:09 2011 +0000 +++ b/libpurple/protocols/mxit/roster.c Sun May 08 14:06:04 2011 +0000 @@ -474,7 +474,7 @@ contact->capabilities = flags; /* validate mood */ - if (( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_STRESSED )) + if ( ( contact->mood < MXIT_MOOD_NONE ) || ( contact->mood > MXIT_MOOD_STRESSED ) ) contact->mood = MXIT_MOOD_NONE; g_strlcpy( contact->customMood, customMood, sizeof( contact->customMood ) ); @@ -485,7 +485,7 @@ g_free( contact->statusMsg ); contact->statusMsg = NULL; } - if ( statusMsg[0] != '\0' ) + if ( ( statusMsg ) && ( statusMsg[0] != '\0' ) ) contact->statusMsg = g_markup_escape_text( statusMsg, -1 ); /* update the buddy's status (reference: "libpurple/prpl.h") */ @@ -747,7 +747,14 @@ * you accept an invite. so in that case the user is already * in our blist and ready to be chatted to. */ - mxit_send_invite( session, buddy_name, TRUE, buddy_alias, group_name, message ); + + if ( buddy_name[0] == '#' ) { + gchar *tmp = (gchar*) purple_base64_decode( buddy_name + 1, NULL ); + mxit_send_invite( session, tmp, FALSE, buddy_alias, group_name, message ); + g_free( tmp ); + } + else + mxit_send_invite( session, buddy_name, TRUE, buddy_alias, group_name, message ); } else { purple_debug_info( MXIT_PLUGIN_ID, "mxit_add_buddy (scenario 2) (list:%i)\n", g_slist_length( list ) );