Mercurial > pidgin.yaz
changeset 30419:207662bad69c
* Show the buddy's registration country in their profile.
* We cannot see the buddy's current "hidden number" setting in their profile,
so we need to use the value they had set when they invited us.
author | andrew.victor@mxit.com |
---|---|
date | Wed, 19 May 2010 20:29:31 +0000 |
parents | 26e4c9dcb1e1 |
children | 5622de6b7b8d |
files | libpurple/protocols/mxit/mxit.c libpurple/protocols/mxit/profile.c libpurple/protocols/mxit/profile.h libpurple/protocols/mxit/protocol.c libpurple/protocols/mxit/protocol.h libpurple/protocols/mxit/roster.h |
diffstat | 6 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/mxit/mxit.c Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/mxit.c Wed May 19 20:29:31 2010 +0000 @@ -552,8 +552,8 @@ static void mxit_get_info( PurpleConnection *gc, const char *who ) { struct MXitSession* session = (struct MXitSession*) gc->proto_data; - const char* profilelist[] = { CP_PROFILE_BIRTHDATE, CP_PROFILE_GENDER, CP_PROFILE_HIDENUMBER, CP_PROFILE_FULLNAME, - CP_PROFILE_TITLE, CP_PROFILE_FIRSTNAME, CP_PROFILE_LASTNAME, CP_PROFILE_EMAIL }; + const char* profilelist[] = { CP_PROFILE_BIRTHDATE, CP_PROFILE_GENDER, CP_PROFILE_FULLNAME, + CP_PROFILE_FIRSTNAME, CP_PROFILE_LASTNAME, CP_PROFILE_REGCOUNTRY }; purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_info: '%s'\n", who );
--- a/libpurple/protocols/mxit/profile.c Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/profile.c Wed May 19 20:29:31 2010 +0000 @@ -123,13 +123,14 @@ purple_notify_user_info_add_pair( info, _( "Nick Name" ), profile->nickname ); purple_notify_user_info_add_pair( info, _( "Birthday" ), profile->birthday ); purple_notify_user_info_add_pair( info, _( "Gender" ), profile->male ? _( "Male" ) : _( "Female" ) ); - purple_notify_user_info_add_pair( info, _( "Hidden Number" ), profile->hidden ? _( "Yes" ) : _( "No" ) ); +// purple_notify_user_info_add_pair( info, _( "Hidden Number" ), profile->hidden ? _( "Yes" ) : _( "No" ) ); /* optional information */ // purple_notify_user_info_add_pair( info, _( "Title" ), profile->title ); purple_notify_user_info_add_pair( info, _( "First Name" ), profile->firstname ); purple_notify_user_info_add_pair( info, _( "Last Name" ), profile->lastname ); // purple_notify_user_info_add_pair( info, _( "Email" ), profile->email ); + purple_notify_user_info_add_pair( info, _( "Country" ), profile->regcountry ); purple_notify_user_info_add_section_break( info ); @@ -149,6 +150,10 @@ /* subscription type */ purple_notify_user_info_add_pair( info, _( "Subscription" ), mxit_convert_subtype_to_name( contact->subtype ) ); + + /* hidden number */ + purple_notify_user_info_add_pair( info, _( "Hidden Number" ), ( contact->flags & MXIT_CFLAG_HIDDEN ) ? _( "Yes" ) : _( "No" ) ); + } purple_notify_userinfo( session->con, username, info, NULL, NULL );
--- a/libpurple/protocols/mxit/profile.h Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/profile.h Wed May 19 20:29:31 2010 +0000 @@ -43,6 +43,7 @@ char lastname[64]; /* user's last name (aka 'surname') */ char email[64]; /* user's email address */ char mobilenr[21]; /* user's mobile number */ + char regcountry[3]; /* user's registered country code */ gboolean hidden; /* set if the user's msisdn should remain hidden */ };
--- a/libpurple/protocols/mxit/protocol.c Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/protocol.c Wed May 19 20:29:31 2010 +0000 @@ -1647,6 +1647,10 @@ /* mobile number */ g_strlcpy( profile->mobilenr, fvalue, sizeof( profile->mobilenr ) ); } + else if ( strcmp( CP_PROFILE_REGCOUNTRY, fname ) == 0 ) { + /* registered country */ + g_strlcpy( profile->regcountry, fvalue, sizeof( profile->regcountry ) ); + } else { /* invalid profile attribute */ purple_debug_error( MXIT_PLUGIN_ID, "Invalid profile attribute received '%s' \n", fname );
--- a/libpurple/protocols/mxit/protocol.h Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/protocol.h Wed May 19 20:29:31 2010 +0000 @@ -188,6 +188,7 @@ #define CP_PROFILE_LASTNAME "lastname" /* Last name (UTF8 String) */ #define CP_PROFILE_EMAIL "email" /* Email address (UTF8 String) */ #define CP_PROFILE_MOBILENR "mobilenumber" /* Mobile Number (UTF8 String) */ +#define CP_PROFILE_REGCOUNTRY "registeredcountry" /* Registered Country Code (UTF8 String) */ /* extended profile field types */ #define CP_PROF_TYPE_BOOL 0x02 /* boolean profile attribute type */
--- a/libpurple/protocols/mxit/roster.h Wed May 19 19:50:36 2010 +0000 +++ b/libpurple/protocols/mxit/roster.h Wed May 19 20:29:31 2010 +0000 @@ -105,7 +105,7 @@ short presence; /* presence state */ short subtype; /* subscription type */ - char* msg; /* invite message */ + char* msg; /* invite/rejection message */ char customMood[16]; /* custom mood */ char* statusMsg; /* status message */