changeset 30716:8816f2c9ae43

propagate from branch 'im.pidgin.pidgin' (head 1a7a779bc2131e1ccb4153db0f799a791246c84b) to branch 'im.pidgin.pidgin.mxit' (head 8fe017f89f6289d2aa1a7d0437e389895095f933)
author andrew.victor@mxit.com
date Fri, 16 Jul 2010 12:15:28 +0000
parents 28d5f60910c9 (current diff) 3221b1107811 (diff)
children 08d9cdac2b3c
files
diffstat 11 files changed, 53 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/actions.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/actions.c	Fri Jul 16 12:15:28 2010 +0000
@@ -225,12 +225,14 @@
 	group = purple_request_field_group_new( NULL );
 	purple_request_fields_add_group( fields, group );
 
-	/* mxitId (read-only) */
-	if ( session->mxitId ) {
-		field = purple_request_field_string_new( "mxitid", _( "Your MXitId" ), session->mxitId, FALSE );
+#if	0
+	/* UID (read-only) */
+	if ( session->uid ) {
+		field = purple_request_field_string_new( "mxitid", _( "Your UID" ), session->uid, FALSE );
 		purple_request_field_string_set_editable( field, FALSE );
 		purple_request_field_group_add_field( group, field );
 	}
+#endif
 
 	/* pin */
 	field = purple_request_field_string_new( "pin", _( "PIN" ), session->acc->password, FALSE );
--- a/libpurple/protocols/mxit/http.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/http.c	Fri Jul 16 12:15:28 2010 +0000
@@ -118,7 +118,7 @@
 		/* read bytes from the socket */
 		len = read( session->fd, buf + buflen, sizeof( buf ) - buflen );
 		if ( len <= 0 ) {
-			/* connection has been terminated, or error occured */
+			/* connection has been terminated, or error occurred */
 			goto done;
 		}
 
@@ -139,7 +139,7 @@
 		}
 		buflen += len;
 
-		/* we have the header's end now skip over the http seperator to get the body offset */
+		/* we have the header's end now skip over the http separator to get the body offset */
 		ch += strlen( HTTP_11_SEPERATOR );
 		*(ch - 1) = '\0';
 		body = ch;
@@ -206,7 +206,7 @@
 		/* read bytes from the socket */
 		len = read( session->fd, &session->rx_dbuf[session->rx_i], session->rx_res );
 		if ( len <= 0 ) {
-			/* connection has been terminated, or error occured */
+			/* connection has been terminated, or error occurred */
 			goto done;
 		}
 
--- a/libpurple/protocols/mxit/login.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/login.c	Fri Jul 16 12:15:28 2010 +0000
@@ -238,7 +238,7 @@
 	/* nickname */
 	str = purple_request_fields_get_string( fields, "nickname" );
 	if ( ( !str ) || ( strlen( str ) < 3 ) ) {
-		err = _( "The nick name you entered is invalid." );
+		err = _( "The Display Name you entered is invalid." );
 		goto out;
 	}
 	g_strlcpy( profile->nickname, str, sizeof( profile->nickname ) );
@@ -329,12 +329,12 @@
 	purple_request_fields_add_group( fields, group );
 
 	/* mxit login name */
-	field = purple_request_field_string_new( "loginname", _( "MXit Login Name" ), purple_account_get_username( session->acc ), FALSE );
+	field = purple_request_field_string_new( "loginname", _( "MXit ID" ), purple_account_get_username( session->acc ), FALSE );
 	purple_request_field_string_set_editable( field, FALSE );
 	purple_request_field_group_add_field( group, field );
 
 	/* nick name (required) */
-	field = purple_request_field_string_new( "nickname", _( "Nick Name" ), profile->nickname, FALSE );
+	field = purple_request_field_string_new( "nickname", _( "Display Name" ), profile->nickname, FALSE );
 	purple_request_field_set_required( field, TRUE );
 	purple_request_field_group_add_field( group, field );
 
@@ -418,10 +418,10 @@
 				purple_connection_error( session->con, _( "Invalid country selected. Please try again." ) );
 				return;
 			case '6' :
-				purple_connection_error( session->con, _( "Username is not registered. Please register first." ) );
+				purple_connection_error( session->con, _( "The MXit ID you entered is not registered. Please register first." ) );
 				return;
 			case '7' :
-				purple_connection_error( session->con, _( "Username is already registered. Please choose another username." ) );
+				purple_connection_error( session->con, _( "The MXit ID you entered is already registered. Please choose another." ) );
 				/* this user's account already exists, so we need to change the registration login flag to be login */
 				purple_account_set_int( session->acc, MXIT_CONFIG_STATE, MXIT_STATE_LOGIN );
 				return;
@@ -637,7 +637,7 @@
 
 	/* add the captcha */
 	logindata->captcha = purple_base64_decode( parts[3], &logindata->captcha_size );
-	field = purple_request_field_image_new( "capcha", _( "Security Code" ), (gchar*) logindata->captcha, logindata->captcha_size );
+	field = purple_request_field_image_new( "captcha", _( "Security Code" ), (gchar*) logindata->captcha, logindata->captcha_size );
 	purple_request_field_group_add_field( group, field );
 
 	/* ask for input (required) */
@@ -659,7 +659,7 @@
 		}
 		purple_request_field_list_add( field, country[1], g_strdup( country[0] ) );
 		if ( strcmp( country[1], parts[6] ) == 0 ) {
-			/* based on the user's ip, this is his current country code, so we default to it */
+			/* based on the user's IP, this is his current country code, so we default to it */
 			purple_request_field_list_add_selected( field, country[1] );
 		}
 		g_strfreev( country );
--- a/libpurple/protocols/mxit/markup.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/markup.c	Fri Jul 16 12:15:28 2010 +0000
@@ -257,7 +257,7 @@
 	 * all the text as is to the conversation window. this message dump is very
 	 * confusing and makes it totally unusable. to work around this we will count
 	 * the amount of tags and if its more than the pidgin threshold, we will just
-	 * break the message up into smaller parts and send them seperately to pidgin.
+	 * break the message up into smaller parts and send them separately to pidgin.
 	 * to the user it will look like multiple messages, but at least he will be able
 	 * to use and understand it.
 	 */
--- a/libpurple/protocols/mxit/multimx.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/multimx.c	Fri Jul 16 12:15:28 2010 +0000
@@ -557,6 +557,9 @@
 {
 	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
 	struct multimx* multimx = NULL;
+	PurpleBuddy* buddy;
+	PurpleConversation *convo;
+	char* tmp;
 
 	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat invite to '%s'\n", username);
 
@@ -569,6 +572,24 @@
 
 	/* Send invite to MXit */
 	mxit_send_groupchat_invite(session, multimx->roomid, 1, &username);
+
+	/* Find the buddy information for this contact (reference: "libpurple/blist.h") */
+	buddy = purple_find_buddy(session->acc, username);
+	if (!buddy) {
+		purple_debug_warning(MXIT_PLUGIN_ID, "mxit_chat_invite: unable to find the buddy '%s'\n", username);
+		return;
+	}
+
+	convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, multimx->roomname, session->acc);
+	if (convo == NULL) {
+		purple_debug_error(MXIT_PLUGIN_ID, "Conversation '%s' not found\n", multimx->roomname);
+		return;
+	}
+
+	/* Display system message in chat window */
+	tmp = g_strdup_printf("%s: %s", _("You have invited"), purple_buddy_get_alias(buddy));
+	purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "MXit", tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
+	g_free(tmp);
 }
 
 
--- a/libpurple/protocols/mxit/mxit.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Fri Jul 16 12:15:28 2010 +0000
@@ -145,7 +145,7 @@
 
 
 /*------------------------------------------------------------------------
- * Unegister MXit from receiving URI click notifications from the UI
+ * Unregister MXit from receiving URI click notifications from the UI
  */
 static void mxit_unregister_uri_handler()
 {
@@ -203,7 +203,7 @@
 	if ( find_active_chat( session->active_chats, who ) )
 		return;
 
-	/* determite if this buddy is a MXit service */
+	/* determine if this buddy is a MXit service */
 	switch ( contact->type ) {
 		case MXIT_TYPE_BOT :
 		case MXIT_TYPE_CHATROOM :
@@ -578,7 +578,7 @@
 
 	table = g_hash_table_new( g_str_hash, g_str_equal );
 
-	g_hash_table_insert( table, "login_label", (gpointer)_( "Your Mobile Number..." ) );
+	g_hash_table_insert( table, "login_label", (gpointer)_( "Your MXit ID..." ) );
 
 	return table;
 }
@@ -594,7 +594,7 @@
 		32, 32,												/* min width & height */
 		MXIT_AVATAR_SIZE,									/* max width */
 		MXIT_AVATAR_SIZE,									/* max height */
-		100000,												/* max filezize */
+		100000,												/* max filesize */
 		PURPLE_ICON_SCALE_SEND | PURPLE_ICON_SCALE_DISPLAY	/* scaling rules */
 	},
 	mxit_list_icon,			/* list_icon */
--- a/libpurple/protocols/mxit/mxit.h	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/mxit.h	Fri Jul 16 12:15:28 2010 +0000
@@ -105,7 +105,7 @@
 /* Client session flags */
 #define		MXIT_FLAG_CONNECTED			0x01		/* established connection to the server */
 #define		MXIT_FLAG_LOGGEDIN			0x02		/* user currently logged in */
-#define		MXIT_FLAG_FIRSTROSTER		0x04		/* set to true once the first roster update has been recevied and processed */
+#define		MXIT_FLAG_FIRSTROSTER		0x04		/* set to true once the first roster update has been received and processed */
 
 
 /* define this to enable the link clicking support */
@@ -151,7 +151,7 @@
 
 	/* personal (profile) */
 	struct MXitProfile*	profile;					/* user's profile information */
-	char*				mxitId;						/* the user's MXitId */
+	char*				uid;						/* the user's UID */
 
 	/* libpurple */
 	PurpleAccount*		acc;						/* pointer to the libpurple internal account struct */
--- a/libpurple/protocols/mxit/profile.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/profile.c	Fri Jul 16 12:15:28 2010 +0000
@@ -120,7 +120,7 @@
 		contact = purple_buddy_get_protocol_data(buddy);
 	}
 
-	purple_notify_user_info_add_pair( info, _( "Nick Name" ), profile->nickname );
+	purple_notify_user_info_add_pair( info, _( "Display 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" ) );
--- a/libpurple/protocols/mxit/protocol.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Fri Jul 16 12:15:28 2010 +0000
@@ -520,7 +520,7 @@
 		/* we are still waiting for an outstanding ACK from the MXit server */
 		if ( session->last_tx <= time( NULL ) - MXIT_ACK_TIMEOUT ) {
 			/* ack timeout! so we close the connection here */
-			purple_debug_info( MXIT_PLUGIN_ID, "mxit_manage_queue: Timeout awaiting ACK for command '%X'\n", session->outack );
+			purple_debug_info( MXIT_PLUGIN_ID, "mxit_manage_queue: Timeout awaiting ACK for command '%i'\n", session->outack );
 			purple_connection_error( session->con, _( "Timeout while waiting for a response from the MXit server." ) );
 		}
 		return TRUE;
@@ -1304,7 +1304,7 @@
 
 	/* extract MXitId (from protocol 5.9) */
 	if ( records[1]->fcount >= 9 )
-		session->mxitId = g_strdup( records[1]->fields[8]->data );
+		session->uid = g_strdup( records[1]->fields[8]->data );
 
 	/* display the current splash-screen */
 	if ( splash_popup_enabled( session ) )
@@ -2487,8 +2487,8 @@
 	mxit_free_emoticon_cache( session );
 
 	/* free allocated memory */
-	if ( session->mxitId )
-		g_free( session->mxitId );
+	if ( session->uid )
+		g_free( session->uid );
 	g_free( session->encpwd );
 	session->encpwd = NULL;
 
--- a/libpurple/protocols/mxit/roster.c	Mon Jul 12 15:15:18 2010 +0000
+++ b/libpurple/protocols/mxit/roster.c	Fri Jul 16 12:15:28 2010 +0000
@@ -44,12 +44,12 @@
 /* statuses (reference: libpurple/status.h) */
 static struct status
 {
-	PurpleStatusPrimitive	primative;
+	PurpleStatusPrimitive	primitive;
 	int						mxit;
 	const char*				id;
 	const char*				name;
 } const mxit_statuses[] = {
-		/*	primative,						no,							id,			name					*/
+		/*	primitive,						no,							id,			name					*/
 		{	PURPLE_STATUS_OFFLINE,			MXIT_PRESENCE_OFFLINE,		"offline",	N_( "Offline" )			},	/* 0 */
 		{	PURPLE_STATUS_AVAILABLE,		MXIT_PRESENCE_ONLINE,		"online",	N_( "Available" )		},	/* 1 */
 		{	PURPLE_STATUS_AWAY,				MXIT_PRESENCE_AWAY,			"away",		N_( "Away" )			},	/* 2 */
@@ -74,7 +74,7 @@
 		const struct status* status = &mxit_statuses[i];
 
 		/* add mxit status (reference: "libpurple/status.h") */
-		type = purple_status_type_new_with_attrs( status->primative, status->id, _( status->name ), TRUE, TRUE, FALSE,
+		type = purple_status_type_new_with_attrs( status->primitive, status->id, _( status->name ), TRUE, TRUE, FALSE,
 					"message", _( "Message" ), purple_value_new( PURPLE_TYPE_STRING ),
 					NULL );
 
@@ -292,7 +292,7 @@
 		 * XXX: libPurple does not currently provide an API to change or rename the group name
 		 * for a specific buddy. One option is to remove the buddy from the list and re-adding
 		 * him in the new group, but by doing that makes the buddy go offline and then online
-		 * again. This is really not ideal and very iretating, but how else then?
+		 * again. This is really not ideal and very irritating, but how else then?
 		 */
 
 		/* create new buddy */
--- a/pidgin/pixmaps/emotes/default/24/default.theme.in	Mon Jul 12 15:15:18 2010 +0000
+++ b/pidgin/pixmaps/emotes/default/24/default.theme.in	Fri Jul 16 12:15:28 2010 +0000
@@ -459,7 +459,7 @@
 wink.png            ;-)     ;)
 excited.png         :-D     :D     :->      :>
 neutral.png         :-|     :|
-shock.png           :-O     :O
+shocked.png         :-O     :O
 tongue.png          :-P     :P
 embarrassed.png     :-$     :$
 glasses-cool.png    8-)