pidgin.mxit: dbc1f520: * Show the buddy's registration country ...
andrew.victor at mxit.com
andrew.victor at mxit.com
Wed May 19 16:35:41 EDT 2010
-----------------------------------------------------------------
Revision: dbc1f520fc5afc4388b93300cc18e56a9330f51c
Ancestor: da5fd4265a1dad44a616ef832446ef04b3730e98
Author: andrew.victor at mxit.com
Date: 2010-05-19T20:29:31
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/dbc1f520fc5afc4388b93300cc18e56a9330f51c
Modified 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
ChangeLog:
* 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.
-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/mxit.c 9f07501e2f99c882fa556f45501a230c063ee103
+++ libpurple/protocols/mxit/mxit.c 17bfe33db888b98f6e9156bd0bfce4ccdaa87fbd
@@ -552,8 +552,8 @@ static void mxit_get_info( PurpleConnect
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 );
============================================================
--- libpurple/protocols/mxit/profile.c b8286347f2c38a4d095393e1afe422c4f17f8809
+++ libpurple/protocols/mxit/profile.c d309b2d1d4748a1bb8ce6f21067c4710d9b6189a
@@ -123,13 +123,14 @@ void mxit_show_profile( struct MXitSessi
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 @@ void mxit_show_profile( struct MXitSessi
/* 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 );
============================================================
--- libpurple/protocols/mxit/profile.h 785ee9d347f038c20117cb6eedee9e7f6f361605
+++ libpurple/protocols/mxit/profile.h 71f371b77af75f04bb8f29ecc2d95b16e297e129
@@ -43,6 +43,7 @@ struct MXitProfile {
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 */
};
============================================================
--- libpurple/protocols/mxit/protocol.c 526588979b939331fb19fbd510c98296ae84e299
+++ libpurple/protocols/mxit/protocol.c c43097c3a27796d611861c27196ef0cb2764b9c2
@@ -1647,6 +1647,10 @@ static void mxit_parse_cmd_extprofile( s
/* 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 );
============================================================
--- libpurple/protocols/mxit/protocol.h 8cc937df699b1e1f26b4aaeda9858d23272be710
+++ libpurple/protocols/mxit/protocol.h 3e0bc909d885e7c4664d151d9391685f0c9ba38d
@@ -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 */
============================================================
--- libpurple/protocols/mxit/roster.h f8e6b14dc9da0b2d64e2313ac95865b63c4e6648
+++ libpurple/protocols/mxit/roster.h 0108cf9e33b5211e8aa632674a8c6c8bc636892b
@@ -105,7 +105,7 @@ struct contact {
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 */
More information about the Commits
mailing list