/pidgin/main: 368feedc80cf: Merge latest changes from release-2....
Andrew Victor
andrew.victor at mxit.com
Wed Apr 3 17:26:46 EDT 2013
Changeset: 368feedc80cf704eb216ec7f51c05ae87b9d6327
Author: Andrew Victor <andrew.victor at mxit.com>
Date: 2013-04-03 23:15 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/368feedc80cf
Description:
Merge latest changes from release-2.x.y to default.
diffstat:
libpurple/protocols/mxit/actions.c | 5 +-
libpurple/protocols/mxit/chunk.c | 5 +-
libpurple/protocols/mxit/cipher.c | 36 +++++++++---------
libpurple/protocols/mxit/filexfer.c | 8 ++-
libpurple/protocols/mxit/formcmds.c | 4 +-
libpurple/protocols/mxit/formcmds.h | 4 +-
libpurple/protocols/mxit/http.c | 4 +-
libpurple/protocols/mxit/login.c | 6 ++-
libpurple/protocols/mxit/markup.c | 20 +++++-----
libpurple/protocols/mxit/multimx.c | 3 +-
libpurple/protocols/mxit/mxit.c | 63 +++++++++++++++++++++++++++++---
libpurple/protocols/mxit/profile.c | 3 +-
libpurple/protocols/mxit/profile.h | 2 -
libpurple/protocols/mxit/protocol.c | 30 ++++++++-------
libpurple/protocols/mxit/roster.c | 6 +-
libpurple/protocols/mxit/splashscreen.c | 6 +-
libpurple/protocols/mxit/voicevideo.c | 3 +-
libpurple/protocols/mxit/voicevideo.h | 5 --
18 files changed, 130 insertions(+), 83 deletions(-)
diffs (truncated from 522 to 300 lines):
diff --git a/libpurple/protocols/mxit/actions.c b/libpurple/protocols/mxit/actions.c
--- a/libpurple/protocols/mxit/actions.c
+++ b/libpurple/protocols/mxit/actions.c
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
+#include "request.h"
#include "protocol.h"
#include "mxit.h"
diff --git a/libpurple/protocols/mxit/chunk.c b/libpurple/protocols/mxit/chunk.c
--- a/libpurple/protocols/mxit/chunk.c
+++ b/libpurple/protocols/mxit/chunk.c
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
+
#include "protocol.h"
#include "mxit.h"
#include "chunk.h"
diff --git a/libpurple/protocols/mxit/cipher.c b/libpurple/protocols/mxit/cipher.c
--- a/libpurple/protocols/mxit/cipher.c
+++ b/libpurple/protocols/mxit/cipher.c
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
#include "mxit.h"
#include "cipher.h"
@@ -107,12 +107,12 @@ static char* transport_layer_key( struct
*/
char* mxit_encrypt_password( struct MXitSession* session )
{
- char key[16 + 1];
- char exkey[512];
- GString* pass = NULL;
- GString* encrypted = NULL;
- char* base64;
- int i;
+ char key[16 + 1];
+ char exkey[512];
+ GString* pass = NULL;
+ GString* encrypted = NULL;
+ char* base64;
+ unsigned int i;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_encrypt_password\n" );
@@ -154,11 +154,11 @@ char* mxit_encrypt_password( struct MXit
*/
char* mxit_decrypt_message( struct MXitSession* session, char* message )
{
- guchar* raw_message;
- gsize raw_len;
- char exkey[512];
- GString* decoded = NULL;
- int i;
+ guchar* raw_message;
+ gsize raw_len;
+ char exkey[512];
+ GString* decoded = NULL;
+ unsigned int i;
/* remove optional header: <mxitencrypted ver="5.2"/> */
if ( strncmp( message, ENCRYPT_HEADER, strlen( ENCRYPT_HEADER ) ) == 0 )
@@ -209,11 +209,11 @@ char* mxit_decrypt_message( struct MXitS
*/
char* mxit_encrypt_message( struct MXitSession* session, char* message )
{
- GString* raw_message = NULL;
- char exkey[512];
- GString* encoded = NULL;
- gchar* base64;
- int i;
+ GString* raw_message = NULL;
+ char exkey[512];
+ GString* encoded = NULL;
+ gchar* base64;
+ unsigned int i;
purple_debug_info( MXIT_PLUGIN_ID, "encrypt message: '%s'\n", message );
diff --git a/libpurple/protocols/mxit/filexfer.c b/libpurple/protocols/mxit/filexfer.c
--- a/libpurple/protocols/mxit/filexfer.c
+++ b/libpurple/protocols/mxit/filexfer.c
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
+
#include "protocol.h"
#include "mxit.h"
#include "chunk.h"
@@ -124,7 +125,7 @@ static void mxit_xfer_init( PurpleXfer*
if ( purple_xfer_get_type( xfer ) == PURPLE_XFER_SEND ) {
/* we are trying to send a file to MXit */
- if ( purple_xfer_get_size( xfer ) > ( CP_MAX_PACKET - 1000 ) ) { /* need to reserve some space for packet headers */
+ if ( purple_xfer_get_size( xfer ) > CP_MAX_FILESIZE ) {
/* the file is too big */
purple_xfer_error( purple_xfer_get_type( xfer ), purple_xfer_get_account( xfer ), purple_xfer_get_remote_user( xfer ), _( "The file you are trying to send is too large!" ) );
purple_xfer_cancel_local( xfer );
@@ -165,6 +166,7 @@ static void mxit_xfer_start( PurpleXfer*
*/
filesize = purple_xfer_get_bytes_remaining( xfer );
buffer = g_malloc( filesize );
+
if ( fread( buffer, filesize, 1, xfer->dest_fp ) > 0 ) {
/* send data */
wrote = purple_xfer_write( xfer, buffer, filesize );
diff --git a/libpurple/protocols/mxit/formcmds.c b/libpurple/protocols/mxit/formcmds.c
--- a/libpurple/protocols/mxit/formcmds.c
+++ b/libpurple/protocols/mxit/formcmds.c
@@ -25,9 +25,7 @@
#include "internal.h"
-#include <glib.h>
-
-#include "purple.h"
+#include "debug.h"
#include "obsolete.h"
#include "protocol.h"
diff --git a/libpurple/protocols/mxit/formcmds.h b/libpurple/protocols/mxit/formcmds.h
--- a/libpurple/protocols/mxit/formcmds.h
+++ b/libpurple/protocols/mxit/formcmds.h
@@ -26,10 +26,8 @@
#ifndef _MXIT_FORMCMDS_H_
#define _MXIT_FORMCMDS_H_
-#include "mxit.h"
-
+#include "protocol.h"
int mxit_parse_command(struct RXMsgData* mx, char* message);
-
#endif /* _MXIT_FORMCMDS_H_ */
diff --git a/libpurple/protocols/mxit/http.c b/libpurple/protocols/mxit/http.c
--- a/libpurple/protocols/mxit/http.c
+++ b/libpurple/protocols/mxit/http.c
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
#include "mxit.h"
#include "protocol.h"
diff --git a/libpurple/protocols/mxit/login.c b/libpurple/protocols/mxit/login.c
--- a/libpurple/protocols/mxit/login.c
+++ b/libpurple/protocols/mxit/login.c
@@ -23,8 +23,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
+#include "request.h"
+#include "version.h"
#include "obsolete.h"
#include "protocol.h"
diff --git a/libpurple/protocols/mxit/markup.c b/libpurple/protocols/mxit/markup.c
--- a/libpurple/protocols/mxit/markup.c
+++ b/libpurple/protocols/mxit/markup.c
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
+#include "internal.h"
+#include "debug.h"
#include "obsolete.h"
#include "protocol.h"
@@ -203,7 +203,7 @@ static unsigned int asn_getlength( const
* @param utf8 The extracted string. Must be deallocated by caller.
* @return The number of bytes extracted
*/
-static int asn_getUtf8( const char* data, char type, char** utf8 )
+static int asn_getUtf8( const char* data, unsigned char type, char** utf8 )
{
int len;
@@ -250,12 +250,12 @@ static void mxit_show_split_message( str
{
GString* msg = NULL;
char* ch = NULL;
- int pos = 0;
- int start = 0;
- int l_nl = 0;
- int l_sp = 0;
- int l_gt = 0;
- int stop = 0;
+ unsigned int pos = 0;
+ unsigned int start = 0;
+ unsigned int l_nl = 0;
+ unsigned int l_sp = 0;
+ unsigned int l_gt = 0;
+ unsigned int stop = 0;
int tags = 0;
gboolean intag = FALSE;
@@ -654,7 +654,7 @@ static void emoticon_request( struct RXM
*/
static int mxit_parse_vibe( struct RXMsgData* mx, const char* message )
{
- int vibeid;
+ unsigned int vibeid;
vibeid = message[2] - '0';
diff --git a/libpurple/protocols/mxit/multimx.c b/libpurple/protocols/mxit/multimx.c
--- a/libpurple/protocols/mxit/multimx.c
+++ b/libpurple/protocols/mxit/multimx.c
@@ -24,8 +24,7 @@
*/
#include "internal.h"
-#include "purple.h"
-#include "prpl.h"
+#include "debug.h"
#include "protocol.h"
#include "mxit.h"
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -23,10 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
-#include "internal.h"
-#include "purple.h"
-#include "notify.h"
-#include "plugin.h"
+#include "internal.h"
+#include "debug.h"
+#include "accountopt.h"
#include "version.h"
#include "mxit.h"
@@ -563,7 +562,7 @@ static void mxit_get_info( PurpleConnect
struct MXitSession* session = purple_connection_get_protocol_data( gc );
const char* profilelist[] = { CP_PROFILE_BIRTHDATE, CP_PROFILE_GENDER, CP_PROFILE_FULLNAME,
CP_PROFILE_FIRSTNAME, CP_PROFILE_LASTNAME, CP_PROFILE_REGCOUNTRY, CP_PROFILE_LASTSEEN,
- CP_PROFILE_STATUS, CP_PROFILE_AVATAR, CP_PROFILE_WHEREAMI, CP_PROFILE_ABOUTME };
+ CP_PROFILE_STATUS, CP_PROFILE_AVATAR, CP_PROFILE_WHEREAMI, CP_PROFILE_ABOUTME, CP_PROFILE_RELATIONSHIP };
purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_info: '%s'\n", who );
@@ -665,6 +664,58 @@ static GHashTable *mxit_chat_info_defaul
}
+/*------------------------------------------------------------------------
+ * Send a typing indicator event.
+ *
+ * @param gc The connection object
+ * @param name The username of the contact
+ * @param state The typing state to be reported.
+ */
+static unsigned int mxit_send_typing( PurpleConnection *gc, const char *name, PurpleTypingState state )
+{
+ PurpleAccount* account = purple_connection_get_account( gc );
+ struct MXitSession* session = purple_connection_get_protocol_data( gc );
+ PurpleBuddy* buddy;
+ struct contact* contact;
+ gchar* messageId = NULL;
+
+ /* find the buddy information for this contact (reference: "libpurple/blist.h") */
+ buddy = purple_find_buddy( account, name );
+ if ( !buddy ) {
More information about the Commits
mailing list