--- a/libpurple/dbus-analyze-functions.py Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/dbus-analyze-functions.py Sat Nov 09 16:17:58 2013 -0500
@@ -1,3 +1,4 @@
+from __future__ import print_function @@ -236,38 +237,38 @@
paramslist = ", ".join(self.paramshdr)
- print "%s %s(%s)" % (self.functiontype, self.function.name,
+ print("%s %s(%s)" % (self.functiontype, self.function.name,
- print 'dbus_g_proxy_call(purple_proxy, "%s", NULL,' % ctopascal(self.function.name)
+ print('dbus_g_proxy_call(purple_proxy, "%s", NULL,' % ctopascal(self.function.name)) for type_name in self.inputparams:
- print "\t%s, %s, " % type_name,
- print "G_TYPE_INVALID,"
+ print("\t%s, %s, " % type_name, end=' ') + print("G_TYPE_INVALID,") for type_name in self.outputparams:
- print "\t%s, &%s, " % type_name,
- print "G_TYPE_INVALID);"
+ print("\t%s, &%s, " % type_name, end=' ') + print("G_TYPE_INVALID);") for code in self.returncode:
def definepurplestructure(self, type):
if (self.headersonly) and (type[0] not in self.knowntypes):
- print "struct _%s;" % type[0]
- print "typedef struct _%s %s;" % (type[0], type[0])
+ print("struct _%s;" % type[0]) + print("typedef struct _%s %s;" % (type[0], type[0])) self.knowntypes.append(type[0])
def inputsimple(self, type, name, us):
@@ -353,39 +354,39 @@
self.argfunc = "dbus_message_get_args"
- print "static DBusMessage*"
- print "%s_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {" % \
+ print("static DBusMessage*") + print("%s_DBUS(DBusMessage *message_DBUS, DBusError *error_DBUS) {" % \ - print "\tDBusMessage *reply_DBUS;"
+ print("\tDBusMessage *reply_DBUS;")
- print "\t%s(message_DBUS, error_DBUS," % self.argfunc,
+ print("\t%s(message_DBUS, error_DBUS," % self.argfunc,end=' ') for param in self.cparams:
- print "DBUS_TYPE_%s, &%s," % param,
- print "DBUS_TYPE_INVALID);"
+ print("DBUS_TYPE_%s, &%s," % param, end=' ') + print("DBUS_TYPE_INVALID);") - print "\tCHECK_ERROR(error_DBUS);"
+ print("\tCHECK_ERROR(error_DBUS);")
- print "\treply_DBUS = dbus_message_new_method_return (message_DBUS);"
+ print("\treply_DBUS = dbus_message_new_method_return (message_DBUS);") - print "\tdbus_message_append_args(reply_DBUS,",
+ print("\tdbus_message_append_args(reply_DBUS,", end=' ') for param in self.cparamsout:
+ print("%s," % param, end=' ') - print "DBUS_TYPE_%s, &%s," % param,
- print "DBUS_TYPE_INVALID);"
+ print("DBUS_TYPE_%s, &%s," % param, end=' ') + print("DBUS_TYPE_INVALID);") for code in self.ccodeout:
- print "\treturn reply_DBUS;\n}\n"
+ print("\treturn reply_DBUS;\n}\n") def addstring(self, *items):
@@ -436,7 +437,7 @@
self.cdecls.append("\t%s *%s;" % (type[0], name))
self.cparams.append(("INT32", name + "_ID"))
self.ccode.append("\tPURPLE_DBUS_ID_TO_POINTER(%s, %s_ID, %s, error_DBUS);" % \
self.addintype("i", name)
def inputpointer(self, type, name):
@@ -539,7 +540,7 @@
- print "/* Generated by %s. Do not edit! */" % sys.argv[0]
+ print("/* Generated by %s. Do not edit! */" % sys.argv[0]) for line in self.inputiter:
@@ -554,7 +555,7 @@
# empty line has been encountered
while (myline.count("(") > myline.count(")")) or self.typeregexp.match(myline):
- newline = self.inputiter.next().strip()
+ newline = next(self.inputiter).strip() @@ -597,15 +598,15 @@
self.functions.append((binding.function.name, binding.dparams))
- print "static PurpleDBusBinding bindings_DBUS[] = { "
+ print("static PurpleDBusBinding bindings_DBUS[] = { ") for function, params in self.functions:
- print '{"%s", "%s", %s_DBUS},' % \
- (ctopascal(function), params, function)
+ print('{"%s", "%s", %s_DBUS},' % \ + (ctopascal(function), params, function)) - print "{NULL, NULL, NULL}"
+ print("{NULL, NULL, NULL}") - print "#define PURPLE_DBUS_REGISTER_BINDINGS(handle) purple_dbus_register_bindings(handle, bindings_DBUS)"
+ print("#define PURPLE_DBUS_REGISTER_BINDINGS(handle) purple_dbus_register_bindings(handle, bindings_DBUS)") class ClientBindingSet (BindingSet):
def __init__(self, inputfile, fprefix, headersonly):
@@ -643,7 +644,7 @@
bindings = ClientBindingSet(sys.stdin, fprefix,
- options.has_key("headers"))
bindings = ServerBindingSet(sys.stdin, fprefix)
--- a/libpurple/dbus-analyze-signals.py Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/dbus-analyze-signals.py Sat Nov 09 16:17:58 2013 -0500
@@ -5,7 +5,7 @@
# <signal name="Changed">
# <arg name="new_value" type="b"/>
+from __future__ import print_function @@ -23,8 +23,8 @@
registerregex = re.compile("purple_signal_register[^;]+\"([\w\-]+)\"[^;]+(purple_marshal_\w+)[^;]+;")
nameregex = re.compile('[-_][a-z]')
-print "/* Generated by %s. Do not edit! */" % sys.argv[0]
-print "const char *dbus_signals = "
+print("/* Generated by %s. Do not edit! */" % sys.argv[0]) +print("const char *dbus_signals = ") for match in registerregex.finditer(sys.stdin.read()):
@@ -32,7 +32,7 @@
signal = nameregex.sub(lambda x:x.group()[1].upper(), '-'+signal)
- print "\" <signal name='%s'>\\n\""%signal
+ print("\" <signal name='%s'>\\n\"" % signal) args = marshal.split('_')
# ['purple', 'marshal', <return type>, '', args...]
@@ -52,9 +52,9 @@
- print "\" <arg type='%s'/>\\n\""%type
+ print("\" <arg type='%s'/>\\n\"" % type) - print "\" </signal>\\n\""
+ print("\" </signal>\\n\"")
--- a/libpurple/dbus-analyze-types.py Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/dbus-analyze-types.py Sat Nov 09 16:17:58 2013 -0500
@@ -7,14 +7,14 @@
# --enum DBUS_POINTER_NAME1,
+from __future__ import print_function @@ -37,39 +37,33 @@
keyword = options.get("keyword", "struct")
pattern = options.get("pattern", "%s")
-verbatim = options.has_key("verbatim")
+verbatim = "verbatim" in options structregexp1 = re.compile(r"^(typedef\s+)?%s\s+\w+\s+(\w+)\s*;" % keyword)
structregexp2 = re.compile(r"^(typedef\s+)?%s" % keyword)
structregexp3 = re.compile(r"^}\s+(\w+)\s*;")
-print "/* Generated by %s. Do not edit! */" % sys.argv[0]
+print("/* Generated by %s. Do not edit! */" % sys.argv[0]) myinput = iter(sys.stdin)
match = structregexp1.match(line)
- print toprint(match.group(2), line)
+ print(toprint(match.group(2), line)) match = structregexp2.match(line)
match = structregexp3.match(line)
- print toprint(match.group(1), line)
+ print(toprint(match.group(1), line)) if line[0] not in [" ", "\t", "{", "\n"]:
--- a/libpurple/dnssrv.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/dnssrv.c Sat Nov 09 16:17:58 2013 -0500
@@ -61,13 +61,6 @@
-static DNS_STATUS (WINAPI *MyDnsQuery_UTF8) (
- PCSTR lpstrName, WORD wType, DWORD fOptions,
- PIP4_ARRAY aipServers, PDNS_RECORD* ppQueryResultsSet,
- PVOID* pReserved) = NULL;
-static void (WINAPI *MyDnsRecordListFree) (PDNS_RECORD pRecordList,
- DNS_FREE_TYPE FreeType) = NULL;
struct _PurpleSrvTxtQueryData {
@@ -646,7 +639,7 @@
PurpleSrvTxtQueryData *query_data = data;
- ds = MyDnsQuery_UTF8(query_data->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL);
+ ds = DnsQuery_UTF8(query_data->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL); if (ds != ERROR_SUCCESS) {
gchar *msg = g_win32_error_message(ds);
if (type == DNS_TYPE_SRV) {
@@ -679,7 +672,7 @@
lst = g_list_prepend(lst, srvres);
- MyDnsRecordListFree(dr, DnsFreeRecordList);
+ DnsRecordListFree(dr, DnsFreeRecordList); query_data->results = purple_srv_sort(lst);
} else if (type == DNS_TYPE_TXT) {
@@ -707,7 +700,7 @@
lst = g_list_append(lst, txtres);
- MyDnsRecordListFree(dr, DnsFreeRecordList);
+ DnsRecordListFree(dr, DnsFreeRecordList); query_data->results = lst;
@@ -747,7 +740,6 @@
- static gboolean initialized = FALSE;
if (!protocol || !*protocol || !transport || !*transport || !domain || !*domain) {
@@ -836,21 +828,10 @@
- MyDnsQuery_UTF8 = (void*) wpurple_find_and_loadproc("dnsapi.dll", "DnsQuery_UTF8");
- MyDnsRecordListFree = (void*) wpurple_find_and_loadproc(
- "dnsapi.dll", "DnsRecordListFree");
- if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree)
- query_data->error_message = g_strdup("System missing DNS API (Requires W2K+)\n");
- query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
- if (query_data->resolver == NULL) {
- query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", (err && err->message) ? err->message : "");
+ query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err); + if (query_data->resolver == NULL) { + query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", (err && err->message) ? err->message : ""); /* The query isn't going to happen, so finish the SRV lookup now.
@@ -883,7 +864,6 @@
- static gboolean initialized = FALSE;
proxy_type = purple_proxy_info_get_type(
@@ -967,21 +947,10 @@
- MyDnsQuery_UTF8 = (void*) wpurple_find_and_loadproc("dnsapi.dll", "DnsQuery_UTF8");
- MyDnsRecordListFree = (void*) wpurple_find_and_loadproc(
- "dnsapi.dll", "DnsRecordListFree");
- if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree)
- query_data->error_message = g_strdup("System missing DNS API (Requires W2K+)\n");
- query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
- if (query_data->resolver == NULL) {
- query_data->error_message = g_strdup_printf("TXT thread create failure: %s\n", (err && err->message) ? err->message : "");
+ query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err); + if (query_data->resolver == NULL) { + query_data->error_message = g_strdup_printf("TXT thread create failure: %s\n", (err && err->message) ? err->message : ""); /* The query isn't going to happen, so finish the TXT lookup now.
--- a/libpurple/plugins/dbus-buddyicons-example.py Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/plugins/dbus-buddyicons-example.py Sat Nov 09 16:17:58 2013 -0500
@@ -21,6 +21,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+from __future__ import print_function @@ -32,5 +33,5 @@
if purple.PurpleBlistNodeIsBuddy(node):
icon = purple.PurpleBuddyGetIcon(node)
- print purple.PurpleBuddyGetAlias(node)
+ print(purple.PurpleBuddyGetAlias(node)) node = purple.PurpleBlistNodeNext(node, 0)
--- a/libpurple/plugins/startup.py Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/plugins/startup.py Sat Nov 09 16:17:58 2013 -0500
@@ -21,16 +21,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+from __future__ import print_function - print "Usage:", sys.argv[0], """<purple-client> [arguments]
- """, sys.argv[0], "pidgin -d -c /my/home"
+ print("Usage:", sys.argv[0], "<purple-client> [arguments]") + print("\nExample:\n ", sys.argv[0], "pidgin -d -c /my/home") home = os.path.expanduser('~/.purple/')
for arg in range(1, len(sys.argv[1:])):
@@ -47,10 +46,10 @@
if not os.path.isabs(userdir):
userdir = os.path.join(purple.PurpleHomeDir(), userdir)
- print "Already running."
+ print("Already running.") - print "Starting client from a different home directory."
+ print("Starting client from a different home directory.") os.execlp(sys.argv[1], " ".join(sys.argv[2:]))
--- a/libpurple/protocols/gg/gg.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/protocols/gg/gg.c Sat Nov 09 16:17:58 2013 -0500
@@ -62,6 +62,19 @@
/* ----- HELPERS -------------------------------------------------------- */
+static PurpleInputCondition +ggp_tcpsocket_inputcond_gg_to_purple(enum gg_check_t check) + PurpleInputCondition cond = 0; + if (check & GG_CHECK_READ) + cond |= PURPLE_INPUT_READ; + if (check & GG_CHECK_WRITE) + cond |= PURPLE_INPUT_WRITE; * Set up libgadu's proxy.
@@ -123,10 +136,8 @@
if (token->req->state != GG_STATE_DONE) {
purple_input_remove(token->inpa);
token->inpa = purple_input_add(token->req->fd,
- (token->req->check == 1)
- ggp_async_token_handler, gc);
+ ggp_tcpsocket_inputcond_gg_to_purple(token->req->check), + ggp_async_token_handler, gc); @@ -192,58 +203,6 @@
/* ---------------------------------------------------------------------- */
- * Request buddylist from the server.
- * Buddylist is received in the ggp_callback_recv().
- * @param Current action handler.
-static void ggp_action_buddylist_get(PurplePluginAction *action)
- PurpleConnection *gc = (PurpleConnection *)action->context;
- GGPInfo *info = gc->proto_data;
- purple_debug_info("gg", "Downloading...\n");
- gg_userlist_request(info->session, GG_USERLIST_GET, NULL);
- * Upload the buddylist to the server.
- * @param action Current action handler.
-static void ggp_action_buddylist_put(PurplePluginAction *action)
- PurpleConnection *gc = (PurpleConnection *)action->context;
- GGPInfo *info = gc->proto_data;
- char *buddylist = ggp_buddylist_dump(purple_connection_get_account(gc));
- purple_debug_info("gg", "Uploading...\n");
- gg_userlist_request(info->session, GG_USERLIST_PUT, buddylist);
- * Delete buddylist from the server.
- * @param action Current action handler.
-static void ggp_action_buddylist_delete(PurplePluginAction *action)
- PurpleConnection *gc = (PurpleConnection *)action->context;
- GGPInfo *info = gc->proto_data;
- purple_debug_info("gg", "Deleting...\n");
- gg_userlist_request(info->session, GG_USERLIST_PUT, NULL);
static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *filename)
PurpleAccount *account = purple_connection_get_account(gc);
@@ -1731,6 +1690,11 @@
+ purple_input_remove(gc->inpa); + gc->inpa = purple_input_add(info->session->fd, + ggp_tcpsocket_inputcond_gg_to_purple(info->session->check), + ggp_callback_recv, gc); @@ -1809,22 +1773,6 @@
ggp_generic_status_handler(gc, ev->event.status60.uin,
GG_S(ev->event.status60.status), ev->event.status60.descr);
- case GG_EVENT_USERLIST:
- if (ev->event.userlist.type == GG_USERLIST_GET_REPLY) {
- purple_debug_info("gg", "GG_USERLIST_GET_REPLY\n");
- purple_notify_info(gc, NULL,
- _("Buddy list downloaded"),
- _("Your buddy list was downloaded from the server."));
- if (ev->event.userlist.reply != NULL) {
- ggp_buddylist_load(gc, ev->event.userlist.reply);
- purple_debug_info("gg", "GG_USERLIST_PUT_REPLY\n");
- purple_notify_info(gc, NULL,
- _("Buddy list uploaded"),
- _("Your buddy list was stored on the server."));
case GG_EVENT_PUBDIR50_SEARCH_REPLY:
ggp_pubdir_reply_handler(gc, ev->event.pubdir50);
@@ -1905,8 +1853,7 @@
/** XXX I think that this shouldn't be done if ev->type is GG_EVENT_CONN_FAILED or GG_EVENT_CONN_SUCCESS -datallah */
if (info->session->fd >= 0)
gc->inpa = purple_input_add(info->session->fd,
- (info->session->check == 1) ? PURPLE_INPUT_WRITE :
+ ggp_tcpsocket_inputcond_gg_to_purple(info->session->check), ggp_async_login_handler, gc);
@@ -1919,8 +1866,8 @@
purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS\n");
purple_input_remove(gc->inpa);
gc->inpa = purple_input_add(info->session->fd,
- ggp_callback_recv, gc);
+ ggp_tcpsocket_inputcond_gg_to_purple(info->session->check), + ggp_callback_recv, gc); purple_connection_update_progress(gc, _("Connected"), 1, 2);
@@ -2190,8 +2137,9 @@
- gc->inpa = purple_input_add(info->session->fd, PURPLE_INPUT_READ,
- ggp_async_login_handler, gc);
+ gc->inpa = purple_input_add(info->session->fd, + ggp_tcpsocket_inputcond_gg_to_purple(info->session->check), + ggp_async_login_handler, gc); static void ggp_close(PurpleConnection *gc)
@@ -2624,18 +2572,6 @@
m = g_list_append(m, NULL);
- act = purple_plugin_action_new(_("Upload buddylist to Server"),
- ggp_action_buddylist_put);
- m = g_list_append(m, act);
- act = purple_plugin_action_new(_("Download buddylist from Server"),
- ggp_action_buddylist_get);
- m = g_list_append(m, act);
- act = purple_plugin_action_new(_("Delete buddylist from Server"),
- ggp_action_buddylist_delete);
- m = g_list_append(m, act);
act = purple_plugin_action_new(_("Save buddylist to file..."),
ggp_action_buddylist_save);
m = g_list_append(m, act);
--- a/libpurple/protocols/gg/lib/handlers.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/protocols/gg/lib/handlers.c Sat Nov 09 16:17:58 2013 -0500
@@ -1766,7 +1766,7 @@
{ GG_DISCONNECT_ACK, GG_STATE_DISCONNECTING, 0, gg_session_handle_disconnect_ack },
{ GG_XML_EVENT, GG_STATE_CONNECTED, 0, gg_session_handle_xml_event },
{ GG_PUBDIR50_REPLY, GG_STATE_CONNECTED, 0, gg_session_handle_pubdir50_reply },
- { GG_USERLIST_REPLY, GG_STATE_CONNECTED, 0, gg_session_handle_userlist_reply },
+ { GG_USERLIST_REPLY, GG_STATE_CONNECTED, sizeof(char), gg_session_handle_userlist_reply }, { GG_DCC7_ID_REPLY, GG_STATE_CONNECTED, sizeof(struct gg_dcc7_id_reply), gg_session_handle_dcc7_id_reply },
{ GG_DCC7_ACCEPT, GG_STATE_CONNECTED, sizeof(struct gg_dcc7_accept), gg_session_handle_dcc7_accept },
{ GG_DCC7_NEW, GG_STATE_CONNECTED, sizeof(struct gg_dcc7_new), gg_session_handle_dcc7_new },
--- a/libpurple/protocols/mxit/formcmds.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/protocols/mxit/formcmds.c Sat Nov 09 16:17:58 2013 -0500
@@ -267,7 +267,7 @@
if (nm) { /* indicates response must be a structured response */
gchar* seltext = g_markup_escape_text(purple_url_decode(selmsg), -1);
- gchar* replycmd = g_strdup_printf("type=reply|nm=%s|res=%s|err=0", nm, replymsg);
+ gchar* replycmd = g_strdup_printf("type=reply|nm=%s|res=%s|err=0", nm, purple_url_decode(replymsg)); mxit_add_html_link( mx, replycmd, TRUE, seltext );
@@ -298,7 +298,7 @@
selmsg = g_hash_table_lookup(hash, "selmsg"); /* find the selection message */
+ if (selmsg && (strlen(selmsg) > 0)) { text = g_markup_escape_text(purple_url_decode(selmsg), -1);
--- a/libpurple/protocols/mxit/markup.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/protocols/mxit/markup.c Sat Nov 09 16:17:58 2013 -0500
@@ -86,7 +86,7 @@
* @param buf The data to dump
* @param len The length of the data
-static void hex_dump( const char* buf, int len )
+static void hex_dump( const gchar* buf, int len ) @@ -102,11 +102,11 @@
pos += sprintf( &msg[pos], "%04i: ", i );
- pos += sprintf( &msg[pos], "0x%02X ", (unsigned char) buf[i] );
+ pos += sprintf( &msg[pos], "0x%02X ", buf[i] ); pos += sprintf( &msg[pos], "\n" );
- purple_debug_info( MXIT_PLUGIN_ID, msg );
+ purple_debug_info( MXIT_PLUGIN_ID, "%s", msg ); @@ -115,7 +115,7 @@
pos += sprintf( &msg[pos], "\n" );
- purple_debug_info( MXIT_PLUGIN_ID, msg );
+ purple_debug_info( MXIT_PLUGIN_ID, "%s", msg ); @@ -133,27 +133,26 @@
void mxit_add_html_link( struct RXMsgData* mx, const char* replydata, gboolean isStructured, const char* displaytext )
* The link content is encoded as follows:
* MXIT_LINK_KEY | ACCOUNT_USER | ACCOUNT_PROTO | REPLY_TO | REPLY_FORMAT | REPLY_DATA
- len = g_snprintf( retstr, sizeof( retstr ), "%s|%s|%s|%s|%i|%s",
+ link = g_strdup_printf( "%s|%s|%s|%s|%i|%s", purple_account_get_username( mx->session->acc ),
purple_account_get_protocol_id( mx->session->acc ),
- retstr64 = purple_base64_encode( (const unsigned char*) retstr, len );
- g_snprintf( link, sizeof( link ), "%s%s", MXIT_LINK_PREFIX, retstr64 );
+ link64 = purple_base64_encode( (const unsigned char*) link, strlen( link ) ); - g_string_append_printf( mx->msg, "<a href=\"%s\">%s</a>", link, displaytext );
+ g_string_append_printf( mx->msg, "<a href=\"%s%s\">%s</a>", MXIT_LINK_PREFIX, link64, displaytext ); g_string_append_printf( mx->msg, "<b>%s</b>", replydata );
@@ -167,7 +166,7 @@
* @param size The extracted length
* @return The number of bytes extracted
-static unsigned int asn_getlength( const char* data, int* size )
+static unsigned int asn_getlength( const gchar* data, int* size ) @@ -202,14 +201,14 @@
* @param utf8 The extracted string. Must be deallocated by caller.
* @return The number of bytes extracted
-static int asn_getUtf8( const char* data, unsigned char type, char** utf8 )
+static int asn_getUtf8( const gchar* data, gchar type, char** utf8 ) /* validate the field type [1 byte] */
/* this is not a utf-8 string! */
- purple_debug_error( MXIT_PLUGIN_ID, "Invalid UTF-8 encoded string in ASN data (0x%02X)\n", (unsigned char) data[0] );
+ purple_debug_error( MXIT_PLUGIN_ID, "Invalid UTF-8 encoded string in ASN data (got 0x%02X, expected 0x%02X)\n", data[0], type ); @@ -472,9 +471,8 @@
static void emoticon_returned( PurpleUtilFetchUrlData* url_data, gpointer user_data, const gchar* url_text, gsize len, const gchar* error_message )
struct RXMsgData* mx = (struct RXMsgData*) user_data;
- const char* data = url_text;
+ const gchar* data = url_text;
@@ -483,9 +481,7 @@
purple_debug_info( MXIT_PLUGIN_ID, "emoticon_returned\n" );
/* remove request from the async outstanding calls list */
mx->session->async_calls = g_slist_remove( mx->session->async_calls, url_data );
@@ -500,12 +496,8 @@
- /* parse out the emoticon */
- /* validate the binary data received from the wapsite */
+ /* validate that the returned data starts with the magic constant that indicates it is a custom emoticon */ if ( memcmp( MXIT_FRAME_MAGIC, &data[pos], strlen( MXIT_FRAME_MAGIC ) ) != 0 ) {
- /* bad data, magic constant is wrong */
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad magic)\n" );
@@ -513,16 +505,14 @@
/* validate the image frame desc byte */
if ( data[pos] != '\x6F' ) {
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad frame desc)\n" );
- /* get the data length */
+ /* get the frame image data length */ res = asn_getlength( &data[pos], &em_size );
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad frame length)\n" );
@@ -534,7 +524,6 @@
/* utf-8 (emoticon name) */
res = asn_getUtf8( &data[pos], 0x0C, &str );
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad name string)\n" );
@@ -548,7 +537,6 @@
/* utf-8 (emoticon shortcut) */
res = asn_getUtf8( &data[pos], 0x81, &str );
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad shortcut string)\n" );
@@ -560,7 +548,6 @@
/* validate the image data type */
if ( data[pos] != '\x82' ) {
purple_debug_error( MXIT_PLUGIN_ID, "Invalid emoticon received from wapsite (bad data type)\n" );
@@ -580,8 +567,17 @@
purple_debug_info( MXIT_PLUGIN_ID, "read the length '%i'\n", em_size );
+ /* strip the mxit markup tags from the emoticon id (eg, .{XY} -> XY) */ + if ( ( em_id[0] == '.' ) && ( em_id[1] == '{' ) ) { + char emo[MXIT_MAX_EMO_ID + 1]; + parse_emoticon_str( &em_id[2], emo ); if ( g_hash_table_lookup( mx->session->iimages, em_id ) ) {
/* emoticon found in the table, so ignore this one */
@@ -589,12 +585,6 @@
em_data = g_malloc( em_size );
memcpy( em_data, &data[pos], em_size );
- /* strip the mxit markup tags from the emoticon id */
- if ( ( em_id[0] == '.' ) && ( em_id[1] == '{' ) ) {
- parse_emoticon_str( &em_id[2], emo );
/* we now have the emoticon, store it in the imagestore */
id = purple_imgstore_add_with_id( em_data, em_size, NULL );
--- a/libpurple/protocols/mxit/protocol.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/protocols/mxit/protocol.c Sat Nov 09 16:17:58 2013 -0500
@@ -1684,6 +1684,30 @@
/*------------------------------------------------------------------------
+ * Parse the received presence value, and ensure that it is supported. + * @param value The received presence value. + * @return A valid presence value. +static short mxit_parse_presence( const char* value ) + short presence = atoi( value ); + /* ensure that the presence value is valid */ + case MXIT_PRESENCE_OFFLINE : + case MXIT_PRESENCE_ONLINE : + case MXIT_PRESENCE_AWAY : + case MXIT_PRESENCE_DND : + return MXIT_PRESENCE_ONLINE; +/*------------------------------------------------------------------------ * Process a received contact update packet.
* @param session The MXit session object
@@ -1714,7 +1738,7 @@
mxit_strip_domain( contact->username ); /* remove dummy domain */
g_strlcpy( contact->alias, rec->fields[2]->data, sizeof( contact->alias ) );
- contact->presence = atoi( rec->fields[3]->data );
+ contact->presence = mxit_parse_presence( rec->fields[3]->data ); contact->type = atoi( rec->fields[4]->data );
contact->mood = atoi( rec->fields[5]->data );
@@ -1773,7 +1797,7 @@
if ( rec->fcount >= 7 ) /* flags field is included */
flags = atoi( rec->fields[6]->data );
- mxit_update_buddy_presence( session, rec->fields[0]->data, atoi( rec->fields[1]->data ), atoi( rec->fields[2]->data ),
+ mxit_update_buddy_presence( session, rec->fields[0]->data, mxit_parse_presence( rec->fields[1]->data ), atoi( rec->fields[2]->data ), rec->fields[3]->data, rec->fields[4]->data, flags );
mxit_update_buddy_avatar( session, rec->fields[0]->data, rec->fields[5]->data );
--- a/libpurple/prpl.h Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/prpl.h Sat Nov 09 16:17:58 2013 -0500
@@ -417,14 +417,13 @@
* the account is not connected, return -ENOTCONN. If the
* PRPL is unable to send the message for another reason, return
* some other negative value. You can use one of the valid
- * errno values, or just big something. If the message should
- * not be echoed to the conversation window, return 0.
+ * errno values, or just big something. * @param id The id of the chat to send the message to.
* @param message The message to send to the chat.
* @param flags A bitwise OR of #PurpleMessageFlags representing
- * @return A positive number or 0 in case of succes,
+ * @return A positive number or 0 in case of success, * a negative error number in case of failure.
int (*chat_send)(PurpleConnection *, int id, const char *message, PurpleMessageFlags flags);
--- a/libpurple/util.c Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/util.c Sat Nov 09 16:17:58 2013 -0500
@@ -712,7 +712,7 @@
long tzoff = PURPLE_NO_TZ_OFF;
- gboolean mktime_with_utc = TRUE;
+ gboolean mktime_with_utc = FALSE; @@ -813,7 +813,7 @@
} while (*str >= '0' && *str <= '9');
- sign = (*str == '+') ? -1 : 1;
+ sign = (*str == '+') ? 1 : -1; /* Process the timezone */
if (*str == '+' || *str == '-') {
@@ -822,26 +822,29 @@
if (((sscanf(str, "%02d:%02d", &tzhrs, &tzmins) == 2 && (str += 5)) ||
(sscanf(str, "%02d%02d", &tzhrs, &tzmins) == 2 && (str += 4))))
+ mktime_with_utc = TRUE; tzoff = tzhrs * 60 * 60 + tzmins * 60;
- if (rest != NULL && *str != '\0')
} else if (*str == 'Z') {
- mktime_with_utc = FALSE;
+ mktime_with_utc = TRUE;
+ /* No timezone specified. */ + mktime_with_utc = TRUE; --- a/libpurple/win32/global.mak Tue Aug 20 17:36:14 2013 +0200
+++ b/libpurple/win32/global.mak Sat Nov 09 16:17:58 2013 -0500
@@ -17,7 +17,7 @@
BONJOUR_TOP ?= $(WIN32_DEV_TOP)/Bonjour_SDK
LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.9.0
MEANWHILE_TOP ?= $(WIN32_DEV_TOP)/meanwhile-1.0.2_daa3
-NSS_TOP ?= $(WIN32_DEV_TOP)/nss-3.14.3-nspr-4.9.5
+NSS_TOP ?= $(WIN32_DEV_TOP)/nss-3.15.2-nspr-4.10.1 PERL_LIB_TOP ?= $(WIN32_DEV_TOP)/perl-5.10.0
SILC_TOOLKIT ?= $(WIN32_DEV_TOP)/silc-toolkit-1.1.10
TCL_LIB_TOP ?= $(WIN32_DEV_TOP)/tcl-8.4.5
--- a/pidgin/gtkdialogs.c Tue Aug 20 17:36:14 2013 +0200
+++ b/pidgin/gtkdialogs.c Sat Nov 09 16:17:58 2013 -0500
@@ -164,8 +164,7 @@
{N_("Czech"), "cs", "David Vachulka", "david@konstrukce-cad.com"},
{N_("Danish"), "da", "Peter Bach", "bach.peter@gmail.com"},
{N_("Danish"), "da", "Morten Brix Pedersen", "morten@wtf.dk"},
- {N_("German"), "de", "Jochen Kemnade", "jochenkemnade@web.de"},
- {N_("German"), "de", "Björn Voigt", "bjoern@cs.tu-berlin.de"},
+ {N_("German"), "de", "Björn Voigt", "bjoernv@arcor.de"}, {N_("Dzongkha"), "dz", "Norbu", "nor_den@hotmail.com"},
{N_("Dzongkha"), "dz", "Jurmey Rabgay", "jur_gay@yahoo.com"},
{N_("Dzongkha"), "dz", "Wangmo Sherpa", "rinwanshe@yahoo.com"},
@@ -272,6 +271,7 @@
{N_("Czech"), "cs", "Honza Král", NULL},
{N_("Czech"), "cs", "Miloslav Trmac", "mitr@volny.cz"},
{N_("German"), "de", "Daniel Seifert, Karsten Weiss", NULL},
+ {N_("German"), "de", "Jochen Kemnade", "jochenkemnade@web.de"}, {N_("British English"), "en_GB", "Luke Ross", "luke@lukeross.name"},
{N_("Spanish"), "es", "JM Pérez Cáncer", NULL},
{N_("Spanish"), "es", "Nicolás Lichtmaier", NULL},
--- a/pidgin/gtkthemes.c Tue Aug 20 17:36:14 2013 +0200
+++ b/pidgin/gtkthemes.c Sat Nov 09 16:17:58 2013 -0500
@@ -222,9 +222,10 @@
void pidgin_themes_load_smiley_theme(const char *file, gboolean load)
- FILE *f = g_fopen(file, "r");
+ FILE *f = g_fopen(file, "rb"); struct smiley_theme *theme=NULL;
struct smiley_list *list = NULL;
GSList *lst = smiley_themes;
@@ -260,6 +261,7 @@
if (!fgets(buf, sizeof(buf), f)) {
if (buf[0] == '#' || buf[0] == '\0')
@@ -271,6 +273,11 @@
+ if (! g_utf8_validate(buf, -1, NULL)) { + purple_debug_error("gtkthemes", "%s:%d is invalid UTF-8\n", file, line_nbr); @@ -309,10 +316,16 @@
while (*i && !isspace(*i) && li < sizeof(l) - 1) {
if (*i == '\\' && *(i+1) != '\0')
+ next = g_utf8_next_char(i); + if ((next - i) > (sizeof(l) - li -1)) { --- a/pidgin/win32/nsis/pidgin-installer.nsi Tue Aug 20 17:36:14 2013 +0200
+++ b/pidgin/win32/nsis/pidgin-installer.nsi Sat Nov 09 16:17:58 2013 -0500
@@ -537,6 +537,7 @@
Delete "$INSTDIR\ca-certs\CAcert_Root.pem"
Delete "$INSTDIR\ca-certs\Deutsche_Telekom_Root_CA_2.pem"
Delete "$INSTDIR\ca-certs\DigiCertHighAssuranceCA-3.pem"
+ Delete "$INSTDIR\ca-certs\DigiCertHighAssuranceEVRootCA.pem" Delete "$INSTDIR\ca-certs\Entrust.net_Secure_Server_CA.pem"
Delete "$INSTDIR\ca-certs\Equifax_Secure_CA.pem"
Delete "$INSTDIR\ca-certs\Equifax_Secure_Global_eBusiness_CA-1.pem"
--- a/po/de.po Tue Aug 20 17:36:14 2013 +0200
+++ b/po/de.po Sat Nov 09 16:17:58 2013 -0500
@@ -2,8 +2,9 @@
# Pidgin German translation
# Copyright (C) 2001, Daniel Seifert <Pidgin-translation@dseifert.de>
# Copyright (C) 2002, Karsten Weiss <knweiss@gmx.de>
-# Copyright (C) 2002-2013, Björn Voigt <bjoern@cs.tu-berlin.de>,
+# Copyright (C) 2002-2013, Björn Voigt <bjoernv@arcor.de>, # Jochen Kemnade <jochenkemnade@web.de>
+# Copyright (C) 2013, Björn Voigt <bjoernv@arcor.de>, # This file is distributed under the same license as the Pidgin package.
@@ -11,8 +12,8 @@
"Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-04-03 20:47+0200\n"
-"PO-Revision-Date: 2013-04-03 20:46+0200\n"
+"POT-Creation-Date: 2013-07-18 21:34+0200\n" +"PO-Revision-Date: 2013-07-18 21:34+0200\n" "Last-Translator: Björn Voigt <bjoern@cs.tu-berlin.de>\n"
"Language-Team: German <de@li.org>\n"
@@ -2978,7 +2979,7 @@
msgstr "Buddy _untätig wird"
msgid "Buddy _Signs On/Off"
-msgstr "Buddy hat_sich an- oder abgemeldet"
+msgstr "Buddy _sich an- oder abgemeldet hat"