changeset 31504:cce18a0ff43a

Due to the new alpha-numeric loginnames and auto-generated userId's the 'hide number' option is no longer valid/needed for most MXit users. Therefore remove the configuration option, and always enable it.
author andrew.victor@mxit.com
date Mon, 11 Apr 2011 21:28:33 +0000
parents 17875962a0a0
children 67c2d695e8d5
files libpurple/protocols/mxit/actions.c libpurple/protocols/mxit/profile.h libpurple/protocols/mxit/protocol.c
diffstat 3 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/actions.c	Mon Apr 11 21:00:18 2011 +0000
+++ b/libpurple/protocols/mxit/actions.c	Mon Apr 11 21:28:33 2011 +0000
@@ -117,12 +117,12 @@
 		g_string_append( attributes, attrib );
 		acount++;
 
-		/* update hidden */
-		field = purple_request_fields_get_field( fields, "hidden" );
-		profile->hidden = purple_request_field_bool_get_value( field );
-		g_snprintf( attrib, sizeof( attrib ), "\01%s\01%i\01%s", CP_PROFILE_HIDENUMBER, CP_PROFILE_TYPE_BOOL, ( profile->hidden ) ? "1" : "0" );
-		g_string_append( attributes, attrib );
-		acount++;
+		/* force hidden if disabled */
+		if ( profile->hidden == FALSE ) {
+			g_snprintf( attrib, sizeof( attrib ), "\01%s\01%i\01%s", CP_PROFILE_HIDENUMBER, CP_PROFILE_TYPE_BOOL, "1" );
+			g_string_append( attributes, attrib );
+			acount++;
+		}
 
 		/* update birthday */
 		g_strlcpy( profile->birthday, bday, sizeof( profile->birthday ) );
@@ -328,10 +328,6 @@
 		field = purple_request_field_string_new( "mobilenumber", _( "Mobile Number" ), profile->mobilenr, FALSE );
 		purple_request_field_group_add_field( private_group, field );
 
-		/* hidden number */
-		field = purple_request_field_bool_new( "hidden", _( "Hide my number" ), profile->hidden );
-		purple_request_field_group_add_field( private_group, field );
-
 		/* is searchable */
 		field = purple_request_field_bool_new( "searchable", _( "Can be searched" ), ( ( profile->flags & CP_PROF_NOT_SEARCHABLE ) == 0) );
 		purple_request_field_group_add_field( private_group, field );
@@ -344,7 +340,7 @@
 	}
 
 	/* (reference: "libpurple/request.h") */
-	purple_request_fields( gc, _( "Profile" ), _( "Update your Profile" ), _( "Here you can update your MXit profile" ), fields, _( "Set" ),
+	purple_request_fields( gc, _( "Profile" ), _( "Update your MXit Profile" ), NULL, fields, _( "Set" ),
 			G_CALLBACK( mxit_cb_set_profile ), _( "Cancel" ), NULL, purple_connection_get_account( gc ), NULL, NULL, gc );
 }
 
--- a/libpurple/protocols/mxit/profile.h	Mon Apr 11 21:00:18 2011 +0000
+++ b/libpurple/protocols/mxit/profile.h	Mon Apr 11 21:28:33 2011 +0000
@@ -50,7 +50,7 @@
 
 	int			flags;								/* user's profile flags */
 	gint64		lastonline;							/* user's last-online timestamp */
-	gboolean	hidden;								/* set if the user's msisdn should remain hidden */
+	gboolean	hidden;								/* set if the user's mxitid should remain hidden */
 };
 
 struct MXitSession;
--- a/libpurple/protocols/mxit/protocol.c	Mon Apr 11 21:00:18 2011 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Mon Apr 11 21:28:33 2011 +0000
@@ -1464,7 +1464,7 @@
 		session->http_sesid = atoi( records[0]->fields[0]->data );
 	}
 
-	/* extract MXitId (from protocol 5.9) */
+	/* extract UserId (from protocol 5.9) */
 	if ( records[1]->fcount >= 9 )
 		session->uid = g_strdup( records[1]->fields[8]->data );