# HG changeset patch
# User Paul Aurich
# Date 1259515925 0
# Node ID cfca0217d1624f2fdfc0f3775d377fef039ee9d1
# Parent 61cd675b73df44e0a3155c06c817d83fab3660e6# Parent 54db9b78be71aceeae1eda46eb6ca7f285e71b22
merge of '263b34adf7373694b48a494714d66824d6bb3443'
and 'd6f80b7ba5ba2da4ae203eac6f07565721b10ad8'
diff -r 61cd675b73df -r cfca0217d162 ChangeLog
--- a/ChangeLog Sat Nov 28 05:51:05 2009 +0000
+++ b/ChangeLog Sun Nov 29 17:32:05 2009 +0000
@@ -4,6 +4,9 @@
version 2.6.4 (??/??/20??):
libpurple:
* Actually emit the hold signal for media calls.
+ * Don't send Proxy-Authorization headers to HTTP proxy servers until we've
+ received a "407 Proxy Authentication Required" response from the server.
+ (thecrux)
* Added "MXit" protocol plugin, supported and maintained by the MXit folks
themselves (MXit Lifestyle (Pty) Ltd.)
@@ -20,6 +23,7 @@
* The simultaneous login account option is respected when using
the clientLogin authentication method.
* Fix offline message retrieval (broken in 2.6.3)
+ * Fix handling of markup on some messages (broken in 2.6.2)
* Fix SSL when clientLogin is enabled.
* Fix sending and receiving Unicode characters in a Direct IM
@@ -32,6 +36,9 @@
* Fix a random crash that might occur when idle.
* Fix a crash when logging in with some long non-ASCII passwords.
(Shaun Lindsay)
+ * Cache our own friendly name as the server no longer does that for
+ us. Users of older versions may need to re-set their friendly name
+ as it has probably been reset.
XMPP:
* Users connecting to Google Talk now have an "Initiate Chat" context menu
@@ -67,6 +74,9 @@
* Add a hold button to the media window.
* Fix a bug where the conversation backlog stops scrolling in a very busy
chat room.
+ * In the Conversation "Send To" menu, offline buddies appear grayed
+ out (but are still selectable). Previously, only offline buddies on
+ accounts that do not support offline messaging appeared grayed out.
Pidgin Preference and Preference Window Changes:
* Removed the "Use font from theme" and "Conversation Font" preferences
diff -r 61cd675b73df -r cfca0217d162 libpurple/dbus-server.c
--- a/libpurple/dbus-server.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/dbus-server.c Sun Nov 29 17:32:05 2009 +0000
@@ -25,16 +25,16 @@
#define DBUS_API_SUBJECT_TO_CHANGE
#endif
+/* Allow the code below to see deprecated functions, so we can continue to
+ * export them via DBus. */
+#undef PURPLE_DISABLE_DEPRECATED
+
#include "internal.h"
#include
#include
#include
-/* Allow the code below to see deprecated functions, so we can continue to
- * export them via DBus. */
-#undef PURPLE_DISABLE_DEPRECATED
-
#include "account.h"
#include "blist.h"
#include "conversation.h"
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/jabber/bosh.c
--- a/libpurple/protocols/jabber/bosh.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.c Sun Nov 29 17:32:05 2009 +0000
@@ -369,8 +369,8 @@
"sid='%s' "
"to='%s' "
"xml:lang='en' "
- "xmlns='http://jabber.org/protocol/httpbind' "
- "xmlns:xmpp='urn:xmpp:xbosh'",
+ "xmlns='" NS_BOSH "' "
+ "xmlns:xmpp='" NS_XMPP_BOSH "'",
++conn->rid,
conn->sid,
conn->js->user->domain);
@@ -567,13 +567,13 @@
"xml:lang='en' "
"xmpp:version='1.0' "
"ver='1.6' "
- "xmlns:xmpp='urn:xmpp:bosh' "
+ "xmlns:xmpp='" NS_XMPP_BOSH "' "
"rid='%" G_GUINT64_FORMAT "' "
/* TODO: This should be adjusted/adjustable automatically according to
* realtime network behavior */
"wait='60' "
"hold='1' "
- "xmlns='http://jabber.org/protocol/httpbind'/>",
+ "xmlns='" NS_BOSH "'/>",
conn->js->user->domain,
++conn->rid);
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/jabber/message.c
--- a/libpurple/protocols/jabber/message.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/jabber/message.c Sun Nov 29 17:32:05 2009 +0000
@@ -742,13 +742,13 @@
jm->eventitems = g_list_append(jm->eventitems, items);
} else if(!strcmp(child->name, "attention") && !strcmp(xmlns, NS_ATTENTION)) {
jm->hasBuzz = TRUE;
- } else if(!strcmp(child->name, "delay") && !strcmp(xmlns,"urn:xmpp:delay")) {
+ } else if(!strcmp(child->name, "delay") && !strcmp(xmlns, NS_DELAYED_DELIVERY)) {
const char *timestamp = xmlnode_get_attrib(child, "stamp");
jm->delayed = TRUE;
if(timestamp)
jm->sent = purple_str_to_time(timestamp, TRUE, NULL, NULL, NULL);
} else if(!strcmp(child->name, "x")) {
- if(!strcmp(xmlns, "jabber:x:delay")) {
+ if(!strcmp(xmlns, NS_DELAYED_DELIVERY_LEGACY)) {
const char *timestamp = xmlnode_get_attrib(child, "stamp");
jm->delayed = TRUE;
if(timestamp)
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/jabber/namespaces.h
--- a/libpurple/protocols/jabber/namespaces.h Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/jabber/namespaces.h Sun Nov 29 17:32:05 2009 +0000
@@ -60,6 +60,9 @@
#define NS_AVATAR_1_1_DATA "urn:xmpp:avatar:data"
#define NS_AVATAR_1_1_METADATA "urn:xmpp:avatar:metadata"
+/* XEP-0124 Bidirectional-streams Over Synchronous HTTP (BOSH) */
+#define NS_BOSH "http://jabber.org/protocol/httpbind"
+
/* XEP-0191 Simple Communications Blocking */
#define NS_SIMPLE_BLOCKING "urn:xmpp:blocking"
@@ -69,6 +72,13 @@
/* XEP-0202 Entity Time */
#define NS_ENTITY_TIME "urn:xmpp:time"
+/* XEP-0203 Delayed Delivery (and legacy delayed delivery) */
+#define NS_DELAYED_DELIVERY "urn:xmpp:delay"
+#define NS_DELAYED_DELIVERY_LEGACY "jabber:x:delay"
+
+/* XEP-0206 XMPP over BOSH */
+#define NS_XMPP_BOSH "urn:xmpp:xbosh"
+
/* XEP-0224 Attention */
#define NS_ATTENTION "urn:xmpp:attention:0"
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c Sun Nov 29 17:32:05 2009 +0000
@@ -633,7 +633,7 @@
} else if(xmlns == NULL) {
/* The rest of the cases used to check xmlns individually. */
continue;
- } else if(!strcmp(y->name, "delay") && !strcmp(xmlns, "urn:xmpp:delay")) {
+ } else if(!strcmp(y->name, "delay") && !strcmp(xmlns, NS_DELAYED_DELIVERY)) {
/* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */
delayed = TRUE;
stamp = xmlnode_get_attrib(y, "stamp");
@@ -642,7 +642,7 @@
} else if (g_str_equal(y->name, "nick") && g_str_equal(xmlns, "http://jabber.org/protocol/nick")) {
nickname = xmlnode_get_data(y);
} else if(!strcmp(y->name, "x")) {
- if(!strcmp(xmlns, "jabber:x:delay")) {
+ if(!strcmp(xmlns, NS_DELAYED_DELIVERY_LEGACY)) {
/* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */
delayed = TRUE;
stamp = xmlnode_get_attrib(y, "stamp");
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/msn/contact.c
--- a/libpurple/protocols/msn/contact.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/msn/contact.c Sun Nov 29 17:32:05 2009 +0000
@@ -702,12 +702,15 @@
type = xmlnode_get_data(contactType);
/*setup the Display Name*/
- if (type && !strcmp(type, "Me")){
- char *friendly = NULL;
- if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
- friendly = xmlnode_get_data(displayName);
- purple_connection_set_display_name(session->account->gc, friendly ? purple_url_decode(friendly) : NULL);
- g_free(friendly);
+ if (type && !strcmp(type, "Me")) {
+ if (purple_connection_get_display_name(pc) == NULL) {
+ char *friendly = NULL;
+ if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
+ friendly = xmlnode_get_data(displayName);
+ purple_connection_set_display_name(pc,
+ friendly ? purple_url_decode(friendly) : NULL);
+ g_free(friendly);
+ }
continue; /* Not adding own account as buddy to buddylist */
}
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/msn/msn.c Sun Nov 29 17:32:05 2009 +0000
@@ -1062,6 +1062,9 @@
if (strcmp(username, purple_account_get_username(account)))
purple_account_set_username(account, username);
+ username = purple_account_get_string(account, "display-name", NULL);
+ purple_connection_set_display_name(gc, username);
+
if (!msn_session_connect(session, host, port, http_method))
purple_connection_error_reason(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/msn/notification.c
--- a/libpurple/protocols/msn/notification.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/msn/notification.c Sun Nov 29 17:32:05 2009 +0000
@@ -1408,6 +1408,7 @@
purple_connection_set_display_name(
purple_account_get_connection(session->account),
friendlyname);
+ purple_account_set_string(session->account, "display-name", friendlyname);
}
}
}
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/chunk.c
--- a/libpurple/protocols/mxit/chunk.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/chunk.c Sun Nov 29 17:32:05 2009 +0000
@@ -576,18 +576,17 @@
/* parse the resource chunks */
while ( chunklen > 0 ) {
- struct raw_chunk* chunkhdr = ( struct raw_chunk * ) &chunkdata[pos];
- chunkhdr->length = ntohl( chunkhdr->length ); /* host byte-order */
+ gchar* chunk = &chunkdata[pos];
/* start of chunk data */
- pos += sizeof( struct raw_chunk );
+ pos += MXIT_CHUNK_HEADER_SIZE;
- switch ( chunkhdr->type ) {
+ switch ( chunk_type( chunk ) ) {
case CP_CHUNK_SPLASH : /* splash image */
{
struct splash_chunk* splash = g_new0( struct splash_chunk, 1 );
- mxit_chunk_parse_splash( &chunkdata[pos], chunkhdr->length, splash );
+ mxit_chunk_parse_splash( &chunkdata[pos], chunk_length( chunk ), splash );
cr->resources = g_list_append( cr->resources, splash );
break;
@@ -600,12 +599,12 @@
break;
}
default:
- purple_debug_info( MXIT_PLUGIN_ID, "Unsupported custom resource chunk received (%i)\n", chunkhdr->type );
+ purple_debug_info( MXIT_PLUGIN_ID, "Unsupported custom resource chunk received (%i)\n", chunk_type( chunk) );
}
/* skip over data to next resource chunk */
- pos += chunkhdr->length;
- chunklen -= ( sizeof( struct raw_chunk ) + chunkhdr->length );
+ pos += chunk_length( chunk );
+ chunklen -= ( MXIT_CHUNK_HEADER_SIZE + chunk_length( chunk ) );
}
}
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/chunk.h
--- a/libpurple/protocols/mxit/chunk.h Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/chunk.h Sun Nov 29 17:32:05 2009 +0000
@@ -31,6 +31,8 @@
#define MXIT_CHUNK_FILEID_LEN 8 /* bytes */
+#define MXIT_CHUNK_HEADER_SIZE 5 /* type (1 byte) + length (4 bytes) */
+
/* Multimedia chunk types */
#define CP_CHUNK_NONE 0x00 /* (0) no chunk */
@@ -68,13 +70,35 @@
#define REJECT_BAD_RECIPIENT 4
/*
- * a Chunk header
+ * Chunk header manipulation functions
*/
-struct raw_chunk {
- guint8 type;
- guint32 length;
- gchar data[0];
-} __attribute__ ((packed));
+static inline guint chunk_type( gchar* chunkheader )
+{
+ return *chunkheader;
+}
+
+static inline void set_chunk_type( gchar* chunkheader, guint type )
+{
+ *chunkheader = type;
+}
+
+static inline guint32 chunk_length( gchar* chunkheader )
+{
+ guint32 length = *( (const guint32*) &chunkheader[1] );
+ return htonl( length );
+}
+
+static inline void set_chunk_length( gchar* chunkheader, guint32 size )
+{
+ size = htonl( size );
+ memcpy( &chunkheader[1], &size, sizeof( guint32 ) );
+}
+
+static inline gchar* chunk_data( gchar* chunkheader )
+{
+ return &chunkheader[MXIT_CHUNK_HEADER_SIZE];
+}
+
struct offerfile_chunk {
char fileid[MXIT_CHUNK_FILEID_LEN];
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/formcmds.c
--- a/libpurple/protocols/mxit/formcmds.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/formcmds.c Sun Nov 29 17:32:05 2009 +0000
@@ -239,12 +239,10 @@
replymsg = g_hash_table_lookup(hash, "replymsg"); /* find the reply message */
if ((selmsg) && (replymsg)) {
gchar* seltext = g_markup_escape_text(purple_url_decode(selmsg), -1);
- gchar* replytext = g_markup_escape_text(purple_url_decode(replymsg), -1);
- mxit_add_html_link( mx, replytext, seltext );
+ mxit_add_html_link( mx, purple_url_decode(replymsg), seltext );
g_free(seltext);
- g_free(replytext);
}
}
@@ -345,7 +343,6 @@
* @param message The message text
* @return The length of the command
*/
-//void mxit_command_received(struct MXitSession* session, const char* from, char* message, time_t timestamp)
int mxit_parse_command(struct RXMsgData* mx, char* message)
{
GHashTable* hash = NULL;
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/markup.c
--- a/libpurple/protocols/mxit/markup.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/markup.c Sun Nov 29 17:32:05 2009 +0000
@@ -416,7 +416,6 @@
}
else if ( mx->chatid < 0 ) {
/* normal chat message */
- //serv_got_im( mx->session->con, mx->from, mx->msg->str, mx->flags, mx->timestamp );
mxit_show_split_message( mx );
}
else {
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/mxit.c Sun Nov 29 17:32:05 2009 +0000
@@ -689,9 +689,6 @@
option = purple_account_option_bool_new( _( "Enable splash-screen popup" ), MXIT_CONFIG_SPLASHPOPUP, FALSE );
proto_info.protocol_options = g_list_append( proto_info.protocol_options, option );
-
- if ( sizeof( struct raw_chunk ) != 5 )
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, "sizeof(struct raw_chunk) != 5! MXit probably won't work!\n");
}
PURPLE_INIT_PLUGIN( mxit, init_plugin, plugin_info );
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/mxit.h
--- a/libpurple/protocols/mxit/mxit.h Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/mxit.h Sun Nov 29 17:32:05 2009 +0000
@@ -61,7 +61,7 @@
/* Plugin details */
#define MXIT_PLUGIN_ID "prpl-loubserp-mxit"
#define MXIT_PLUGIN_NAME "MXit"
-#define MXIT_PLUGIN_VERSION "2.2.0"
+#define MXIT_PLUGIN_VERSION "2.3.0"
#define MXIT_PLUGIN_EMAIL "Pieter Loubser "
#define MXIT_PLUGIN_WWW "http://www.mxit.com"
#define MXIT_PLUGIN_SUMMARY "MXit Protocol Plugin"
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/protocol.c
--- a/libpurple/protocols/mxit/protocol.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/protocol.c Sun Nov 29 17:32:05 2009 +0000
@@ -1035,7 +1035,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "SENDING FILE '%s' of %i bytes to user '%s'\n", filename, buflen, username );
@@ -1044,17 +1044,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_senddirect( chunk->data, username, filename, buf, buflen );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_senddirect( chunk_data( chunk ), username, filename, buf, buflen );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating senddirect chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_DIRECT_SND;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_DIRECT_SND );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
@@ -1071,7 +1071,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_reject\n" );
@@ -1080,17 +1080,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_reject( chunk->data, fileid );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_reject( chunk_data( chunk ), fileid );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating reject chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_REJECT;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_REJECT );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
@@ -1109,7 +1109,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_accept\n" );
@@ -1118,17 +1118,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_get( chunk->data, fileid, filesize, offset );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_get( chunk_data(chunk), fileid, filesize, offset );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating getfile chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_GET;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_GET );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
@@ -1145,7 +1145,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_received\n" );
@@ -1154,17 +1154,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_received( chunk->data, fileid, status );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_received( chunk_data(chunk), fileid, status );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating received chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_RECIEVED;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_RECIEVED );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
@@ -1182,7 +1182,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_set_avatar: %i bytes\n", avatarlen );
@@ -1191,17 +1191,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_set_avatar( chunk->data, avatar, avatarlen );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_set_avatar( chunk_data(chunk), avatar, avatarlen );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating set avatar chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_SET_AVATAR;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_SET_AVATAR );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
@@ -1221,7 +1221,7 @@
{
char data[CP_MAX_PACKET];
int datalen = 0;
- struct raw_chunk* chunk;
+ gchar* chunk;
int size;
purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_avatar: %s\n", mxitId );
@@ -1230,17 +1230,17 @@
datalen = sprintf( data, "ms=" );
/* map chunk header over data buffer */
- chunk = (struct raw_chunk *) &data[datalen];
-
- size = mxit_chunk_create_get_avatar( chunk->data, mxitId, avatarId, MXIT_AVATAR_SIZE );
+ chunk = &data[datalen];
+
+ size = mxit_chunk_create_get_avatar( chunk_data(chunk), mxitId, avatarId, MXIT_AVATAR_SIZE );
if ( size < 0 ) {
purple_debug_error( MXIT_PLUGIN_ID, "Error creating get avatar chunk (%i)\n", size );
return;
}
- chunk->type = CP_CHUNK_GET_AVATAR;
- chunk->length = htonl( size );
- datalen += sizeof( struct raw_chunk ) + size;
+ set_chunk_type( chunk, CP_CHUNK_GET_AVATAR );
+ set_chunk_length( chunk, size );
+ datalen += MXIT_CHUNK_HEADER_SIZE + size;
/* send the byte stream to the mxit server */
mxit_queue_packet( session, data, datalen, CP_CMD_MEDIA );
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/roster.c
--- a/libpurple/protocols/mxit/roster.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/roster.c Sun Nov 29 17:32:05 2009 +0000
@@ -53,11 +53,11 @@
const char* name;
} const mxit_statuses[] = {
/* primative, no, id, name */
- { PURPLE_STATUS_OFFLINE, MXIT_PRESENCE_OFFLINE, "offline", NULL }, /* 0 */
- { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_ONLINE, "online", NULL }, /* 1 */
- { PURPLE_STATUS_AWAY, MXIT_PRESENCE_AWAY, "away", NULL }, /* 2 */
- { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_AVAILABLE, "chat", N_( "Chatty" ) }, /* 3 */
- { PURPLE_STATUS_UNAVAILABLE, MXIT_PRESENCE_DND, "dnd", NULL } /* 4 */
+ { 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 */
+ { PURPLE_STATUS_AVAILABLE, MXIT_PRESENCE_AVAILABLE, "chat", N_( "Chatty" ) }, /* 3 */
+ { PURPLE_STATUS_UNAVAILABLE, MXIT_PRESENCE_DND, "dnd", N_( "Do Not Disturb" ) } /* 4 */
};
@@ -398,7 +398,7 @@
contact->statusMsg = NULL;
}
if ( statusMsg[0] != '\0' )
- contact->statusMsg = g_strdup( statusMsg );
+ contact->statusMsg = g_markup_escape_text( statusMsg, -1 );
/* update avatarId */
if ( ( contact->avatarId ) && ( g_ascii_strcasecmp( contact->avatarId, avatarId ) == 0 ) ) {
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/mxit/splashscreen.c
--- a/libpurple/protocols/mxit/splashscreen.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/mxit/splashscreen.c Sun Nov 29 17:32:05 2009 +0000
@@ -43,10 +43,10 @@
{
const char* splashId = purple_account_get_string(session->acc, MXIT_CONFIG_SPLASHID, NULL);
- purple_debug_info(MXIT_PLUGIN_ID, "Current splashId: '%s'\n", splashId);
-
- if ((splashId != NULL) && (*splashId != '\0'))
+ if ((splashId != NULL) && (*splashId != '\0')) {
+ purple_debug_info(MXIT_PLUGIN_ID, "Current splashId: '%s'\n", splashId);
return splashId;
+ }
else
return NULL;
}
@@ -149,7 +149,7 @@
/* Get current splash ID */
splashId = splash_current(session);
- if (!splashId)
+ if (splashId == NULL) /* no splash-screen */
return;
/* if is clickable, then send click event */
diff -r 61cd675b73df -r cfca0217d162 libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c Sat Nov 28 05:51:05 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c Sun Nov 29 17:32:05 2009 +0000
@@ -2461,42 +2461,81 @@
*/
if (purple_markup_find_tag("body", tmp, &start, &end, &attribs))
{
+ int len;
+ char *tmp2, *body;
const char *ichattextcolor, *ichatballooncolor;
- const char *start2, *end2;
+ const char *slash_body_start, *slash_body_end = NULL; /*
but not !\n");
+ /* Take everything after */
+ body = g_strdup(start);
+ }
ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor");
if (ichattextcolor != NULL)
{
- gchar *tmp2;
- tmp2 = g_strdup_printf("%s", ichattextcolor, tmp);
- g_free(tmp);
- tmp = tmp2;
+ tmp2 = g_strdup_printf("%s", ichattextcolor, body);
+ g_free(body);
+ body = tmp2;
}
ichatballooncolor = g_datalist_get_data(&attribs, "ichatballooncolor");
if (ichatballooncolor != NULL)
{
- gchar *tmp2;
- tmp2 = g_strdup_printf("%s", ichatballooncolor, tmp);
- g_free(tmp);
- tmp = tmp2;
+ tmp2 = g_strdup_printf("%s", ichatballooncolor, body);
+ g_free(body);
+ body = tmp2;
}
g_datalist_clear(&attribs);
+
+ len = start - tmp;
+ tmp2 = g_strdup_printf("%.*s%s%s", len, tmp, body, slash_body_end ? slash_body_end + 1: "");
+ g_free(tmp);
+ g_free(body);
+
+ tmp = tmp2;
+ }
+
+ /*
+ * Are there