pidgin.mxit: c60b64b1: Due to the new alpha-numeric loginnames ...

andrew.victor at mxit.com andrew.victor at mxit.com
Mon Apr 11 18:20:59 EDT 2011


----------------------------------------------------------------------
Revision: c60b64b156b1473df2e4f50db62911f47c33c830
Parent:   d025d54be04c39c06c4aad817a948315956c17c0
Author:   andrew.victor at mxit.com
Date:     04/11/11 17:28:33
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/c60b64b156b1473df2e4f50db62911f47c33c830

Changelog: 

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.
  

Changes against parent d025d54be04c39c06c4aad817a948315956c17c0

  patched  libpurple/protocols/mxit/actions.c
  patched  libpurple/protocols/mxit/profile.h
  patched  libpurple/protocols/mxit/protocol.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/actions.c	739d6ed90a11b310fc4163312997fd9737abf50f
+++ libpurple/protocols/mxit/actions.c	153361c508b51e563a34bab10d2eb2ba4bbbd340
@@ -117,12 +117,12 @@ out:
 		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 @@ static void mxit_cb_action_profile( Purp
 		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 @@ static void mxit_cb_action_profile( Purp
 	}
 
 	/* (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 );
 }
 
============================================================
--- libpurple/protocols/mxit/profile.h	a4c773fbc1fcfe33757061f394568f4c05bb0272
+++ libpurple/protocols/mxit/profile.h	acfd17f2ccf5284e49ccccaa762a73c551f92f84
@@ -50,7 +50,7 @@ struct MXitProfile {
 
 	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;
============================================================
--- libpurple/protocols/mxit/protocol.c	2a181692465a065b0cf946cf2f2926ed95821d03
+++ libpurple/protocols/mxit/protocol.c	1f8c375bfb2ad479a7ea8ce7ae06fcb80e0f5f2b
@@ -1464,7 +1464,7 @@ static void mxit_parse_cmd_login( struct
 		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 );
 


More information about the Commits mailing list