pidgin/android/libpurple2
Clone
Merge latest changes from release-2.x.y to default.
--- a/libpurple/protocols/mxit/actions.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/actions.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--- a/libpurple/protocols/mxit/chunk.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/chunk.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--- a/libpurple/protocols/mxit/cipher.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/cipher.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -107,12 +107,12 @@
char* mxit_encrypt_password( struct MXitSession* session )
- GString* encrypted = NULL;
+ GString* encrypted = NULL; purple_debug_info( MXIT_PLUGIN_ID, "mxit_encrypt_password\n" );
@@ -154,11 +154,11 @@
char* mxit_decrypt_message( struct MXitSession* session, char* message )
- GString* decoded = NULL;
+ GString* decoded = NULL; /* remove optional header: <mxitencrypted ver="5.2"/> */
if ( strncmp( message, ENCRYPT_HEADER, strlen( ENCRYPT_HEADER ) ) == 0 )
@@ -209,11 +209,11 @@
char* mxit_encrypt_message( struct MXitSession* session, char* message )
- GString* raw_message = NULL;
- GString* encoded = NULL;
+ GString* raw_message = NULL; + GString* encoded = NULL; purple_debug_info( MXIT_PLUGIN_ID, "encrypt message: '%s'\n", message );
--- a/libpurple/protocols/mxit/filexfer.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/filexfer.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -124,7 +125,7 @@
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 @@
filesize = purple_xfer_get_bytes_remaining( xfer );
buffer = g_malloc( filesize );
if ( fread( buffer, filesize, 1, xfer->dest_fp ) > 0 ) {
wrote = purple_xfer_write( xfer, buffer, filesize );
--- a/libpurple/protocols/mxit/formcmds.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/formcmds.c Wed Apr 03 23:15:20 2013 +0200
@@ -25,9 +25,7 @@
--- a/libpurple/protocols/mxit/formcmds.h Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/formcmds.h Wed Apr 03 23:15:20 2013 +0200
@@ -26,10 +26,8 @@
#ifndef _MXIT_FORMCMDS_H_
#define _MXIT_FORMCMDS_H_
int mxit_parse_command(struct RXMsgData* mx, char* message);
#endif /* _MXIT_FORMCMDS_H_ */
--- a/libpurple/protocols/mxit/http.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/http.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--- a/libpurple/protocols/mxit/login.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/login.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--- a/libpurple/protocols/mxit/markup.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/markup.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -203,7 +203,7 @@
* @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 ) @@ -250,12 +250,12 @@
+ unsigned int start = 0; @@ -654,7 +654,7 @@
static int mxit_parse_vibe( struct RXMsgData* mx, const char* message )
vibeid = message[2] - '0';
--- a/libpurple/protocols/mxit/multimx.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/multimx.c Wed Apr 03 23:15:20 2013 +0200
@@ -24,8 +24,7 @@
--- a/libpurple/protocols/mxit/mxit.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/mxit.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,10 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -563,7 +562,7 @@
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 @@
+/*------------------------------------------------------------------------ + * 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 ); + struct contact* contact; + gchar* messageId = NULL; + /* find the buddy information for this contact (reference: "libpurple/blist.h") */ + buddy = purple_find_buddy( account, name ); + purple_debug_warning( MXIT_PLUGIN_ID, "mxit_send_typing: unable to find the buddy '%s'\n", name ); + contact = purple_buddy_get_protocol_data( buddy ); + /* does this contact support and want typing notification? */ + if ( ! ( contact->capabilities & MXIT_PFLAG_TYPING ) ) + messageId = purple_uuid_random(); /* generate a unique message id */ + case PURPLE_TYPING : /* currently typing */ + mxit_send_msgevent( session, name, messageId, CP_MSGEVENT_TYPING ); + case PURPLE_TYPED : /* stopped typing */ + case PURPLE_NOT_TYPING : /* not typing / erased all text */ + mxit_send_msgevent( session, name, messageId, CP_MSGEVENT_STOPPED ); /*========================================================================================================================*/
static PurplePluginProtocolInfo proto_info = {
@@ -691,7 +742,7 @@
mxit_send_im, /* send_im */
- NULL, /* send_typing */
+ mxit_send_typing, /* send_typing */ mxit_get_info, /* get_info */
mxit_set_status, /* set_status */
--- a/libpurple/protocols/mxit/profile.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/profile.c Wed Apr 03 23:15:20 2013 +0200
@@ -26,8 +26,7 @@
--- a/libpurple/protocols/mxit/profile.h Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/profile.h Wed Apr 03 23:15:20 2013 +0200
@@ -26,8 +26,6 @@
/* MXit relationship status types */
#define MXIT_RELATIONSHIP_UNKNOWN 0
--- a/libpurple/protocols/mxit/protocol.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/protocol.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -100,26 +101,27 @@
void dump_bytes( struct MXitSession* session, const char* buf, int len )
- char msg[( len * 3 ) + 1];
- memset( msg, 0x00, sizeof( msg ) );
+ char* msg = g_malloc0( len + 1 ); for ( i = 0; i < len; i++ ) {
- if ( buf[i] == CP_REC_TERM ) /* record terminator */
+ if ( ch == CP_REC_TERM ) /* record terminator */ - else if ( buf[i] == CP_FLD_TERM ) /* field terminator */
+ else if ( ch == CP_FLD_TERM ) /* field terminator */ - else if ( buf[i] == CP_PKT_TERM ) /* packet terminator */
+ else if ( ch == CP_PKT_TERM ) /* packet terminator */ - else if ( buf[i] < 0x20 )
+ else if ( ( ch < 0x20 ) || ( ch > 0x7E ) ) /* non-printable character */
purple_debug_info( MXIT_PLUGIN_ID, "DUMP: '%s'\n", msg );
@@ -721,7 +723,7 @@
"%s%c%i%c%s%c%s%c" /* dateOfBirth\1gender\1location\1capabilities\1 */
"%s%c%i%c%s%c%s" /* dc\1features\1dialingcode\1locale */
"%c%i%c%i", /* \1protocolVer\1lastRosterUpdate */
- session->encpwd, CP_FLD_TERM, clientVersion, CP_FLD_TERM, CP_MAX_PACKET, CP_FLD_TERM, profile->nickname, CP_FLD_TERM,
+ session->encpwd, CP_FLD_TERM, clientVersion, CP_FLD_TERM, CP_MAX_FILESIZE, CP_FLD_TERM, profile->nickname, CP_FLD_TERM, profile->birthday, CP_FLD_TERM, ( profile->male ) ? 1 : 0, CP_FLD_TERM, MXIT_DEFAULT_LOC, CP_FLD_TERM, MXIT_CP_CAP, CP_FLD_TERM,
session->distcode, CP_FLD_TERM, features, CP_FLD_TERM, session->dialcode, CP_FLD_TERM, locale,
CP_FLD_TERM, MXIT_CP_PROTO_VESION, CP_FLD_TERM, 0
@@ -768,7 +770,7 @@
session->encpwd, CP_FLD_TERM, clientVersion, CP_FLD_TERM, 1, CP_FLD_TERM,
MXIT_CP_CAP, CP_FLD_TERM, session->distcode, CP_FLD_TERM, features, CP_FLD_TERM,
session->dialcode, CP_FLD_TERM, locale, CP_FLD_TERM,
- CP_MAX_PACKET, CP_FLD_TERM, MXIT_CP_PROTO_VESION, CP_FLD_TERM, 0
+ CP_MAX_FILESIZE, CP_FLD_TERM, MXIT_CP_PROTO_VESION, CP_FLD_TERM, 0 /* include "custom resource" information */
--- a/libpurple/protocols/mxit/roster.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/roster.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
@@ -672,7 +672,7 @@
struct contact* con = NULL;
struct contact* match = NULL;
/* run through all the invites and try and find the match */
for ( i = 0; i < g_list_length( session->invites ); i++ ) {
--- a/libpurple/protocols/mxit/splashscreen.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/splashscreen.c Wed Apr 03 23:15:20 2013 +0200
@@ -24,9 +24,9 @@
@@ -121,7 +121,7 @@
/* Save the new splash image */
- dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "mxit", purple_user_dir());
+ dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "mxit", purple_user_dir()); purple_build_dir(dir, S_IRUSR | S_IWUSR | S_IXUSR); /* ensure directory exists */
filename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s.png", dir, purple_escape_filename(splashId));
--- a/libpurple/protocols/mxit/voicevideo.c Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/voicevideo.c Wed Apr 03 23:15:20 2013 +0200
@@ -23,7 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
--- a/libpurple/protocols/mxit/voicevideo.h Tue Apr 02 09:20:41 2013 -0400
+++ b/libpurple/protocols/mxit/voicevideo.h Wed Apr 03 23:15:20 2013 +0200
@@ -26,16 +26,11 @@
#ifndef _MXIT_VOICEVICEO_H_
#define _MXIT_VOICEVIDEO_H_
gboolean mxit_audio_enabled(void);
gboolean mxit_video_enabled(void);
PurpleMediaCaps mxit_media_caps(PurpleAccount* account, const char* who);
gboolean mxit_media_initiate(PurpleAccount* account, const char* who, PurpleMediaSessionType type);
#endif /* _MXIT_VOICEVIDEO_H_ */