From: <sea...@us...> - 2006-06-08 01:28:19
|
Revision: 16230 Author: seanegan Date: 2006-06-07 18:15:26 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16230&view=rev Log Message: ----------- backport to 2.0.0 Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/src/Makefile.am branches/v2_0_0/src/gtkdialogs.c branches/v2_0_0/src/protocols/jabber/Makefile.am branches/v2_0_0/src/protocols/jabber/auth.c branches/v2_0_0/src/protocols/jabber/buddy.c branches/v2_0_0/src/protocols/jabber/chat.c branches/v2_0_0/src/protocols/jabber/disco.c branches/v2_0_0/src/protocols/jabber/iq.c branches/v2_0_0/src/protocols/jabber/jabber.c branches/v2_0_0/src/protocols/jabber/jabber.h branches/v2_0_0/src/protocols/jabber/message.c branches/v2_0_0/src/protocols/jabber/oob.c branches/v2_0_0/src/protocols/jabber/parser.c branches/v2_0_0/src/protocols/jabber/presence.c branches/v2_0_0/src/protocols/jabber/si.c branches/v2_0_0/src/protocols/jabber/xdata.c branches/v2_0_0/src/xmlnode.c branches/v2_0_0/src/xmlnode.h Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/configure.ac 2006-06-08 01:15:26 UTC (rev 16230) @@ -171,6 +171,17 @@ AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for making sounds]) fi +dnl ################# +dnl # LibXML2 +dnl ################# +enable_libxml=yes +PKG_CHECK_MODULES(LIBXML, libxml-2.0, ,enable_libxml=no) +AC_SUBST(LIBXML_CFLAGS) +AC_SUBST(LIBXML_LIBS) +if test "x$enable_libxml" = "xyes"; then + AC_DEFINE(HAVE_LIBXML, 1, [Use libxml2 for xml parsing]) +fi + dnl ####################################################################### dnl # Check for Meanwhile headers (for Sametime) dnl ####################################################################### Modified: branches/v2_0_0/src/Makefile.am =================================================================== --- branches/v2_0_0/src/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/Makefile.am 2006-06-08 01:15:26 UTC (rev 16230) @@ -347,7 +347,8 @@ $(SM_LIBS) \ $(INTLLIBS) \ $(GTKSPELL_LIBS) \ - $(STARTUP_NOTIFICATION_LIBS) + $(STARTUP_NOTIFICATION_LIBS) \ + $(LIBXML_LIBS) AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ @@ -361,4 +362,5 @@ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ $(GTKSPELL_CFLAGS) \ - $(STARTUP_NOTIFICATION_CFLAGS) + $(STARTUP_NOTIFICATION_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: branches/v2_0_0/src/gtkdialogs.c =================================================================== --- branches/v2_0_0/src/gtkdialogs.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/gtkdialogs.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -438,6 +438,12 @@ #endif #endif +#ifdef HAVE_LIBXML + g_string_append_printf(str, " <b>XML Parser:</b> libxml2<br/>"); +#else + g_string_append_printf(str, " <b>XML Parser:</b> GMarkup<br/>"); +#endif + #ifdef HAVE_LIBGADU #ifdef _WIN32 g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Internal<br/>"); Modified: branches/v2_0_0/src/protocols/jabber/Makefile.am =================================================================== --- branches/v2_0_0/src/protocols/jabber/Makefile.am 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/Makefile.am 2006-06-08 01:15:26 UTC (rev 16230) @@ -60,4 +60,5 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ $(DEBUG_CFLAGS) \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + $(LIBXML_CFLAGS) Modified: branches/v2_0_0/src/protocols/jabber/auth.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/auth.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/auth.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -67,7 +67,7 @@ gchar *enc_out; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); response = g_string_new(""); response = g_string_append_len(response, "\0", 1); @@ -269,7 +269,7 @@ if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) { auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth,"mechanism", mech); if (clientout) { if (coutlen == 0) { @@ -386,7 +386,7 @@ js->auth_type = JABBER_AUTH_DIGEST_MD5; auth = xmlnode_new("auth"); - xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); xmlnode_set_attrib(auth, "mechanism", "DIGEST-MD5"); jabber_send(js, auth); @@ -720,7 +720,7 @@ return; } else { response = xmlnode_new("response"); - xmlnode_set_attrib(response, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); + xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl"); if (c_out) { enc_out = gaim_base64_encode((unsigned char*)c_out, clen); xmlnode_insert_data(response, enc_out, -1); @@ -735,7 +735,7 @@ void jabber_auth_handle_success(JabberStream *js, xmlnode *packet) { - const char *ns = xmlnode_get_attrib(packet, "xmlns"); + const char *ns = xmlnode_get_namespace(packet); #ifdef HAVE_CYRUS_SASL int *x; #endif Modified: branches/v2_0_0/src/protocols/jabber/buddy.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/buddy.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/buddy.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -1108,7 +1108,7 @@ xmlnode_set_attrib(iq->node, "to", jid); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse, jbi); jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); Modified: branches/v2_0_0/src/protocols/jabber/chat.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/chat.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/chat.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -162,7 +162,7 @@ if(chat->muc) { xmlnode_set_attrib(message, "to", room_jid); x = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc#user"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user"); invite = xmlnode_new_child(x, "invite"); xmlnode_set_attrib(invite, "to", name); body = xmlnode_new_child(invite, "reason"); @@ -173,7 +173,7 @@ xmlnode_insert_data(body, msg, -1); x = xmlnode_new_child(message, "x"); xmlnode_set_attrib(x, "jid", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:conference"); + xmlnode_set_namespace(x, "jabber:x:conference"); } jabber_send(js, message); @@ -267,7 +267,7 @@ g_free(full_jid); x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "http://jabber.org/protocol/muc"); + xmlnode_set_namespace(x, "http://jabber.org/protocol/muc"); if(passwd && *passwd) { xmlnode *password = xmlnode_new_child(x, "password"); @@ -380,7 +380,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { @@ -451,7 +451,7 @@ room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); xmlnode_set_attrib(iq->node, "to", room_jid); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); jabber_iq_send(iq); @@ -524,7 +524,7 @@ for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns"))) + if(!(xmlns = xmlnode_get_namespace(x))) continue; if(!strcmp(xmlns, "jabber:x:data")) { Modified: branches/v2_0_0/src/protocols/jabber/disco.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/disco.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/disco.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -104,7 +104,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); inf = xmlnode_new_child(error, "item-not-found"); - xmlnode_set_attrib(inf, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/iq.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/iq.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/iq.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -78,7 +78,7 @@ xmlnode *query; query = xmlnode_new_child(iq->node, "query"); - xmlnode_set_attrib(query, "xmlns", xmlns); + xmlnode_set_namespace(query, xmlns); return iq; } @@ -268,7 +268,7 @@ /* Apparently not, so lets see if we have a pre-defined handler */ - if(type && query && (xmlns = xmlnode_get_attrib(query, "xmlns"))) { + if(type && query && (xmlns = xmlnode_get_namespace(query))) { if(!strcmp(type, "set")) { if(!strcmp(xmlns, "jabber:iq:roster")) { jabber_roster_parse(js, packet); @@ -329,7 +329,7 @@ xmlnode_set_attrib(error, "type", "cancel"); xmlnode_set_attrib(error, "code", "501"); x = xmlnode_new_child(error, "feature-not-implemented"); - xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas"); jabber_iq_send(iq); } Modified: branches/v2_0_0/src/protocols/jabber/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -63,9 +63,9 @@ "xmlns:stream='http://etherx.jabber.org/streams' " "version='1.0'>", js->user->domain); - + /* setup the parser fresh for each stream */ + jabber_parser_setup(js); jabber_send_raw(js, open_stream, -1); - g_free(open_stream); } @@ -88,7 +88,7 @@ jabber_iq_set_callback(iq, jabber_session_initialized_cb, NULL); session = xmlnode_new_child(iq->node, "session"); - xmlnode_set_attrib(session, "xmlns", "urn:ietf:params:xml:ns:xmpp-session"); + xmlnode_set_namespace(session, "urn:ietf:params:xml:ns:xmpp-session"); jabber_iq_send(iq); } @@ -137,7 +137,7 @@ xmlnode *bind, *resource; JabberIq *iq = jabber_iq_new(js, JABBER_IQ_SET); bind = xmlnode_new_child(iq->node, "bind"); - xmlnode_set_attrib(bind, "xmlns", "urn:ietf:params:xml:ns:xmpp-bind"); + xmlnode_set_namespace(bind, "urn:ietf:params:xml:ns:xmpp-bind"); resource = xmlnode_new_child(bind, "resource"); xmlnode_insert_data(resource, js->user->resource, -1); @@ -174,8 +174,14 @@ jabber_message_parse(js, packet); } else if(!strcmp(packet->name, "stream:features")) { jabber_stream_features_parse(js, packet); + } else if (!strcmp(packet->name, "features") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_features_parse(js, packet); } else if(!strcmp(packet->name, "stream:error")) { jabber_stream_handle_error(js, packet); + } else if (!strcmp(packet->name, "error") && + !strcmp(xmlnode_get_namespace(packet), "http://etherx.jabber.org/streams")) { + jabber_stream_handle_error(js, packet); } else if(!strcmp(packet->name, "challenge")) { if(js->state == JABBER_STREAM_AUTHENTICATING) jabber_auth_handle_challenge(js, packet); @@ -405,7 +411,6 @@ if(js->state == JABBER_STREAM_CONNECTING) jabber_send_raw(js, "<?xml version='1.0' ?>", -1); - jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING); gaim_ssl_input_add(gsc, jabber_recv_cb_ssl, gc); } @@ -923,9 +928,10 @@ gaim_input_remove(js->gc->inpa); close(js->fd); } - +#ifndef HAVE_LIBXML if(js->context) g_markup_parse_context_free(js->context); +#endif if(js->iq_callbacks) g_hash_table_destroy(js->iq_callbacks); if(js->disco_callbacks) @@ -981,7 +987,6 @@ gaim_connection_update_progress(js->gc, _("Initializing Stream"), js->gsc ? 5 : 2, JABBER_CONNECT_STEPS); jabber_stream_init(js); - jabber_parser_setup(js); break; case JABBER_STREAM_AUTHENTICATING: gaim_connection_update_progress(js->gc, _("Authenticating"), @@ -1400,7 +1405,7 @@ { xmlnode *error; const char *code = NULL, *text = NULL; - const char *xmlns = xmlnode_get_attrib(packet, "xmlns"); + const char *xmlns = xmlnode_get_namespace(packet); char *cdata = NULL; if((error = xmlnode_get_child(packet, "error"))) { Modified: branches/v2_0_0/src/protocols/jabber/jabber.h =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.h 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/jabber.h 2006-06-08 01:15:26 UTC (rev 16230) @@ -22,6 +22,9 @@ #ifndef _GAIM_JABBER_H_ #define _GAIM_JABBER_H_ +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <glib.h> #include "connection.h" #include "roomlist.h" @@ -64,7 +67,11 @@ { int fd; +#ifdef HAVE_LIBXML + xmlParserCtxt *context; +#else GMarkupParseContext *context; +#endif xmlnode *current; enum { Modified: branches/v2_0_0/src/protocols/jabber/message.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/message.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/message.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -123,7 +123,7 @@ for(etc = jm->etc; etc; etc = etc->next) { xmlnode *x = etc->data; - const char *xmlns = xmlnode_get_attrib(x, "xmlns"); + const char *xmlns = xmlnode_get_namespace(x); if(xmlns && !strcmp(xmlns, "jabber:x:oob")) { xmlnode *url, *desc; char *urltxt, *desctxt; @@ -325,7 +325,7 @@ g_free(code_txt); g_free(text); } else if(!strcmp(child->name, "x")) { - const char *xmlns = xmlnode_get_attrib(child, "xmlns"); + const char *xmlns = xmlnode_get_namespace(child); if(xmlns && !strcmp(xmlns, "jabber:x:event")) { if(xmlnode_get_child(child, "composing")) { if(jm->chat_state == JM_STATE_ACTIVE) @@ -440,7 +440,7 @@ if(JM_TS_JEP_0022 == (jm->typing_style & JM_TS_JEP_0022)) { child = xmlnode_new_child(message, "x"); - xmlnode_set_attrib(child, "xmlns", "jabber:x:event"); + xmlnode_set_namespace(child, "jabber:x:event"); if(jm->chat_state == JM_STATE_COMPOSING || jm->body) xmlnode_new_child(child, "composing"); } @@ -466,7 +466,7 @@ break; } if(child) - xmlnode_set_attrib(child, "xmlns", "http://jabber.org/protocol/chatstates"); + xmlnode_set_namespace(child, "http://jabber.org/protocol/chatstates"); } if(jm->subject) { Modified: branches/v2_0_0/src/protocols/jabber/oob.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/oob.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/oob.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -168,11 +168,11 @@ if(!strcmp(code, "406")) { z = xmlnode_new_child(y, "not-acceptable"); xmlnode_set_attrib(y, "type", "modify"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } else if(!strcmp(code, "404")) { z = xmlnode_new_child(y, "not-found"); xmlnode_set_attrib(y, "type", "cancel"); - xmlnode_set_attrib(z, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(z, "urn:ietf:params:xml:ns:xmpp-stanzas"); } jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/parser.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/parser.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/parser.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -20,12 +20,17 @@ */ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif + #include "connection.h" - +#include "debug.h" #include "jabber.h" #include "parser.h" #include "xmlnode.h" +#ifndef HAVE_LIBXML static void jabber_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, @@ -104,6 +109,136 @@ xmlnode_insert_data(js->current, text, text_len); } +#else /* HAVE_LIBXML */ + +static void +jabber_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + JabberStream *js = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else if(!strcmp(element_name, "stream")) { + js->protocol_version = JABBER_PROTO_0_9; + for(i=0; i < nb_attributes * 5; i += 5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + + if(!strcmp(attributes[i], "version") + && !strcmp(attrib, "1.0")) { + js->protocol_version = JABBER_PROTO_1_0; + } else if(!strcmp(attributes[i], "id")) { + if(js->stream_id) + g_free(js->stream_id); + js->stream_id = g_strdup(attrib); + } + g_free(attrib); + } + if(js->protocol_version == JABBER_PROTO_0_9) + js->auth_type = JABBER_AUTH_IQ_AUTH; + + if(js->state == JABBER_STREAM_INITIALIZING) + jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); + } else { + + if(js->current) + node = xmlnode_new_child(js->current, element_name); + else + node = xmlnode_new(element_name); + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + js->current = node; + } +} + +static void +jabber_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(js->current->parent) { + if(!strcmp(js->current->name, element_name)) + js->current = js->current->parent; + } else { + xmlnode *packet = js->current; + js->current = NULL; + jabber_process_packet(js, packet); + xmlnode_free(packet); + } +} + +static void +jabber_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + JabberStream *js = user_data; + + if(!js->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(js->current, text, text_len); +} +#endif /* HAVE_LIBXML */ + + +#ifdef HAVE_LIBXML +static xmlSAXHandler jabber_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = jabber_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = jabber_parser_element_start_libxml, + .endElementNs = jabber_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser jabber_parser = { jabber_parser_element_start, jabber_parser_element_end, @@ -111,24 +246,47 @@ NULL, NULL }; +#endif void jabber_parser_setup(JabberStream *js) { +#ifdef HAVE_LIBXML + /* This seems backwards, but it makes sense. The libxml code creates the parser + * context when you try to use it (this way, it can figure out the encoding at + * creation time. So, setting up the parser is just a matter of destroying any + * current parser. */ + if (js->context) { + xmlParseChunk(js->context, NULL,0,1); + xmlFreeParserCtxt(js->context); + js->context = NULL; + } +#else if(!js->context) js->context = g_markup_parse_context_new(&jabber_parser, 0, js, NULL); +#endif } void jabber_parser_process(JabberStream *js, const char *buf, int len) { +#ifndef HAVE_LIBXML /* May need to check for other encodings and do the conversion here */ - if(!g_markup_parse_context_parse(js->context, buf, len, NULL)) { g_markup_parse_context_free(js->context); js->context = NULL; gaim_connection_error(js->gc, _("XML Parse error")); } +#else + if (js->context == NULL) { + /* libxml inconsistently starts parsing on creating the parser, so so a ParseChunk + * right afterwards to force it. */ + js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL); + xmlParseChunk(js->context, NULL, 0, 0); + } else if (xmlParseChunk(js->context, buf, len, 0) < 0) { + gaim_connection_error(js->gc, _("XML Parse error")); + } +#endif } Modified: branches/v2_0_0/src/protocols/jabber/presence.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -121,7 +121,7 @@ if(js->avatar_hash) { x = xmlnode_new_child(presence, "x"); - xmlnode_set_attrib(x, "xmlns", "vcard-temp:x:update"); + xmlnode_set_namespace(x, "vcard-temp:x:update"); photo = xmlnode_new_child(x, "photo"); xmlnode_insert_data(photo, js->avatar_hash, -1); } @@ -167,7 +167,7 @@ /* JEP-0115 */ c = xmlnode_new_child(presence, "c"); - xmlnode_set_attrib(c, "xmlns", "http://jabber.org/protocol/caps"); + xmlnode_set_namespace(c, "http://jabber.org/protocol/caps"); xmlnode_set_attrib(c, "node", CAPS0115_NODE); xmlnode_set_attrib(c, "ver", VERSION); @@ -290,7 +290,6 @@ gboolean muc = FALSE; char *avatar_hash = NULL; - if(!(jb = jabber_buddy_find(js, from, TRUE))) return; @@ -363,7 +362,7 @@ g_free(p); } } else if(!strcmp(y->name, "x")) { - const char *xmlns = xmlnode_get_attrib(y, "xmlns"); + const char *xmlns = xmlnode_get_namespace(y); if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { /* XXX: compare the time. jabber:x:delay can happen on presence packets that aren't really and truly delayed */ delayed = TRUE; @@ -464,7 +463,7 @@ for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) { const char *xmlns, *nick, *code; xmlnode *stat, *item; - if(!(xmlns = xmlnode_get_attrib(x, "xmlns")) || + if(!(xmlns = xmlnode_get_namespace(x)) || strcmp(xmlns, "http://jabber.org/protocol/muc#user")) continue; if(!(stat = xmlnode_get_child(x, "status"))) @@ -560,7 +559,7 @@ iq = jabber_iq_new(js, JABBER_IQ_GET); xmlnode_set_attrib(iq->node, "to", buddy_name); vcard = xmlnode_new_child(iq->node, "vCard"); - xmlnode_set_attrib(vcard, "xmlns", "vcard-temp"); + xmlnode_set_namespace(vcard, "vcard-temp"); jabber_iq_set_callback(iq, jabber_vcard_parse_avatar, NULL); jabber_iq_send(iq); Modified: branches/v2_0_0/src/protocols/jabber/si.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/si.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/si.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -139,7 +139,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); condition = xmlnode_new_child(error, "condition"); - xmlnode_set_attrib(condition, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); xmlnode_new_child(condition, "item-not-found"); jabber_iq_send(iq); @@ -637,14 +637,14 @@ iq = jabber_iq_new(jsx->js, JABBER_IQ_SET); xmlnode_set_attrib(iq->node, "to", xfer->who); si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); jsx->stream_id = jabber_get_next_id(jsx->js); xmlnode_set_attrib(si, "id", jsx->stream_id); xmlnode_set_attrib(si, "profile", "http://jabber.org/protocol/si/profile/file-transfer"); file = xmlnode_new_child(si, "file"); - xmlnode_set_attrib(file, "xmlns", + xmlnode_set_namespace(file, "http://jabber.org/protocol/si/profile/file-transfer"); xmlnode_set_attrib(file, "name", xfer->filename); g_snprintf(buf, sizeof(buf), "%" G_GSIZE_FORMAT, xfer->size); @@ -652,10 +652,10 @@ /* maybe later we'll do hash and date attribs */ feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "form"); field = xmlnode_new_child(x, "field"); xmlnode_set_attrib(field, "var", "stream-method"); @@ -771,13 +771,13 @@ jsx->accepted = TRUE; si = xmlnode_new_child(iq->node, "si"); - xmlnode_set_attrib(si, "xmlns", "http://jabber.org/protocol/si"); + xmlnode_set_namespace(si, "http://jabber.org/protocol/si"); feature = xmlnode_new_child(si, "feature"); - xmlnode_set_attrib(feature, "xmlns", "http://jabber.org/protocol/feature-neg"); + xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg"); x = xmlnode_new_child(feature, "x"); - xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(x, "jabber:x:data"); xmlnode_set_attrib(x, "type", "submit"); field = xmlnode_new_child(x, "field"); Modified: branches/v2_0_0/src/protocols/jabber/xdata.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/xdata.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/protocols/jabber/xdata.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -49,7 +49,7 @@ JabberStream *js = data->js; GList *groups, *flds; - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "submit"); for(groups = gaim_request_fields_get_groups(fields); groups; groups = groups->next) { @@ -140,7 +140,7 @@ } g_free(data); - xmlnode_set_attrib(result, "xmlns", "jabber:x:data"); + xmlnode_set_namespace(result, "jabber:x:data"); xmlnode_set_attrib(result, "type", "cancel"); cb(js, result, user_data); Modified: branches/v2_0_0/src/xmlnode.c =================================================================== --- branches/v2_0_0/src/xmlnode.c 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/xmlnode.c 2006-06-08 01:15:26 UTC (rev 16230) @@ -29,6 +29,9 @@ #include "internal.h" +#ifdef HAVE_LIBXML +#include <libxml/parser.h> +#endif #include <string.h> #include <glib.h> @@ -172,6 +175,32 @@ return NULL; } + +void xmlnode_set_namespace(xmlnode *node, const char *xmlns) +{ +#ifdef HAVE_LIBXML + g_return_if_fail(node != NULL); + + if (node->namespace) + g_free(node->namespace); + + node->namespace = g_strdup(xmlns); +#else + return xmlnode_set_attrib(node, "xmlns", xmlns); +#endif +} + +const char *xmlnode_get_namespace(xmlnode *node) +{ +#ifdef HAVE_LIBXML + g_return_val_if_fail(node != NULL, NULL); + + return node->namespace; +#else + return xmlnode_get_attrib(node, "xmlns"); +#endif +} + void xmlnode_free(xmlnode *node) { @@ -190,6 +219,10 @@ g_free(node->name); if(node->data) g_free(node->data); +#ifdef HAVE_LIBXML + if(node->namespace) + g_free(node->namespace); +#endif g_free(node); } @@ -216,7 +249,7 @@ for(x = parent->child; x; x = x->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(x, "xmlns"); + xmlns = xmlnode_get_namespace(x); if(x->type == XMLNODE_TYPE_TAG && name && !strcmp(parent_name, x->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) { @@ -272,6 +305,13 @@ node_name = g_markup_escape_text(node->name, -1); g_string_append_printf(text, "<%s", node_name); +#ifdef HAVE_LIBXML + if (node->namespace) { + char *namespace = g_markup_escape_text(node->namespace, -1); + g_string_append_printf(text, " xmlns='%s'", namespace); + g_free(namespace); + } +#endif for(c = node->child; c; c = c->next) { if(c->type == XMLNODE_TYPE_ATTRIB) { @@ -347,7 +387,72 @@ xmlnode *current; }; +#ifdef HAVE_LIBXML static void +xmlnode_parser_element_start_libxml(void *user_data, + const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace, + int nb_namespaces, const xmlChar **namespaces, + int nb_attributes, int nb_defaulted, const xmlChar **attributes) +{ + struct _xmlnode_parser_data *xpd = user_data; + xmlnode *node; + int i; + + if(!element_name) { + return; + } else { + if(xpd->current) + node = xmlnode_new_child(xpd->current, element_name); + else + node = xmlnode_new(element_name); + + xmlnode_set_namespace(node, namespace); + + for(i=0; i < nb_attributes * 5; i+=5) { + int attrib_len = attributes[i+4] - attributes[i+3]; + char *attrib = g_malloc(attrib_len + 1); + memcpy(attrib, attributes[i+3], attrib_len); + attrib[attrib_len] = '\0'; + xmlnode_set_attrib(node, attributes[i], attrib); + g_free(attrib); + } + + xpd->current = node; + } +} + +static void +xmlnode_parser_element_end_libxml(void *user_data, const xmlChar *element_name, + const xmlChar *prefix, const xmlChar *namespace) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!element_name || !xpd->current) + return; + + if(xpd->current->parent) { + if(!strcmp(xpd->current->name, element_name)) + xpd->current = xpd->current->parent; + } +} + +static void +xmlnode_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) +{ + struct _xmlnode_parser_data *xpd = user_data; + + if(!xpd->current) + return; + + if(!text || !text_len) + return; + + xmlnode_insert_data(xpd->current, text, text_len); +} + +#else + +static void xmlnode_parser_element_start(GMarkupParseContext *context, const char *element_name, const char **attrib_names, const char **attrib_values, gpointer user_data, GError **error) @@ -400,7 +505,44 @@ xmlnode_insert_data(xpd->current, text, text_len); } +#endif +#ifdef HAVE_LIBXML +static xmlSAXHandler xmlnode_parser_libxml = { + .internalSubset = NULL, + .isStandalone = NULL, + .hasInternalSubset = NULL, + .hasExternalSubset = NULL, + .resolveEntity = NULL, + .getEntity = NULL, + .entityDecl = NULL, + .notationDecl = NULL, + .attributeDecl = NULL, + .elementDecl = NULL, + .unparsedEntityDecl = NULL, + .setDocumentLocator = NULL, + .startDocument = NULL, + .endDocument = NULL, + .startElement = NULL, + .endElement = NULL, + .reference = NULL, + .characters = xmlnode_parser_element_text_libxml, + .ignorableWhitespace = NULL, + .processingInstruction = NULL, + .comment = NULL, + .warning = NULL, + .error = NULL, + .fatalError = NULL, + .getParameterEntity = NULL, + .cdataBlock = NULL, + .externalSubset = NULL, + .initialized = XML_SAX2_MAGIC, + ._private = NULL, + .startElementNs = xmlnode_parser_element_start_libxml, + .endElementNs = xmlnode_parser_element_end_libxml, + .serror = NULL +}; +#else static GMarkupParser xmlnode_parser = { xmlnode_parser_element_start, xmlnode_parser_element_end, @@ -408,8 +550,8 @@ NULL, NULL }; +#endif - xmlnode * xmlnode_from_str(const char *str, gssize size) { @@ -422,6 +564,16 @@ real_size = size < 0 ? strlen(str) : size; xpd = g_new0(struct _xmlnode_parser_data, 1); + +#ifdef HAVE_LIBXML + if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, size) < 0) { + while(xpd->current && xpd->current->parent) + xpd->current = xpd->current->parent; + if(xpd->current) + xmlnode_free(xpd->current); + xpd->current = NULL; + } +#else context = g_markup_parse_context_new(&xmlnode_parser, 0, xpd, NULL); if(!g_markup_parse_context_parse(context, str, real_size, NULL)) { @@ -432,7 +584,7 @@ xpd->current = NULL; } g_markup_parse_context_free(context); - +#endif ret = xpd->current; g_free(xpd); return ret; @@ -477,7 +629,7 @@ xmlnode_get_next_twin(xmlnode *node) { xmlnode *sibling; - const char *ns = xmlnode_get_attrib(node, "xmlns"); + const char *ns = xmlnode_get_namespace(node); g_return_val_if_fail(node != NULL, NULL); g_return_val_if_fail(node->type == XMLNODE_TYPE_TAG, NULL); @@ -485,7 +637,7 @@ for(sibling = node->next; sibling; sibling = sibling->next) { const char *xmlns = NULL; if(ns) - xmlns = xmlnode_get_attrib(sibling, "xmlns"); + xmlns = xmlnode_get_namespace(sibling); if(sibling->type == XMLNODE_TYPE_TAG && !strcmp(node->name, sibling->name) && (!ns || (xmlns && !strcmp(ns, xmlns)))) Modified: branches/v2_0_0/src/xmlnode.h =================================================================== --- branches/v2_0_0/src/xmlnode.h 2006-06-08 01:03:51 UTC (rev 16229) +++ branches/v2_0_0/src/xmlnode.h 2006-06-08 01:15:26 UTC (rev 16230) @@ -41,6 +41,9 @@ typedef struct _xmlnode { char *name; /**< The name of the node. */ +#ifdef HAVE_LIBXML + char *namespace; /**< The namespace of the node */ +#endif XMLNodeType type; /**< The type of the node. */ char *data; /**< The data for the node. */ size_t data_sz; /**< The size of the data. */ @@ -154,6 +157,22 @@ void xmlnode_remove_attrib(xmlnode *node, const char *attr); /** + * Sets the namespace of a node + * + * @param node The node to qualify + * @param xmlns The namespace of the node + */ +void xmlnode_set_namespace(xmlnode *node, const char *xmlns); + +/** + * Returns the namespace of a node + * + * @param node The node to get the namepsace from + * @return The namespace of this node + */ +const char *xmlnode_get_namespace(xmlnode *node); + +/** * Returns the node in a string of xml. * * @param node The starting node to output. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-06-08 15:20:46
|
Revision: 16236 Author: datallah Date: 2006-06-08 08:20:38 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16236&view=rev Log Message: ----------- Backport of 16234:16235. ----------------------------------------------------- Use libxml2 on win32 too. This increases the installer size by ~400K (oh well). ----------------------------------------------------- svn:ignore installer executables Modified Paths: -------------- branches/v2_0_0/Makefile.mingw branches/v2_0_0/config.h.mingw branches/v2_0_0/gaim-installer.nsi branches/v2_0_0/src/Makefile.mingw branches/v2_0_0/src/protocols/jabber/Makefile.mingw Property Changed: ---------------- branches/v2_0_0/ Property changes on: branches/v2_0_0 ___________________________________________________________________ Name: svn:ignore - ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir + ABOUT-NLS aclocal.m4 autom4te.cache compile confdefs.h config.cache config.guess config.h config.h.in config.h.in~ config.log config.status config.sub configure configure.2.1x depcomp Doxyfile gaim.apspec gaim.desktop gaim.pc gaim.service gaim.spec install-sh intl intltool-extract intltool-extract.in intltool-merge intltool-merge.in intltool-update intltool-update.in libtool ltconfig ltmain.sh Makefile Makefile.in missing stamp-h stamp-h1 stamp-h.in *.swp .temp-gettextize win32-install-dir gaim-*.exe Modified: branches/v2_0_0/Makefile.mingw =================================================================== --- branches/v2_0_0/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -12,6 +12,7 @@ GAIM_SOUNDS = ./sounds GAIM_INSTALL_DIR = ./win32-install-dir GTKSPELL_TOP = ../win32-dev/gtkspell-2.0.6/gtkspell +LIBXML2_DIR = ../win32-dev/libxml2 IDLETRACK_TOP = $(GAIM_SRC)/win32/IdleTracker GTKRC_TOP = ../win32-dev/gtkrc OSCAR = $(GAIM_PROTOS)/oscar @@ -33,7 +34,8 @@ VERSION := $(shell cat ./VERSION) NEEDED_DLLS = $(GTKSPELL_TOP)/libgtkspell.dll \ - $(IDLETRACK_TOP)/idletrack.dll + $(IDLETRACK_TOP)/idletrack.dll \ + $(LIBXML2_DIR)/bin/libxml2.dll SOUNDS = $(GAIM_SOUNDS)/alert.wav \ $(GAIM_SOUNDS)/login.wav \ Modified: branches/v2_0_0/config.h.mingw =================================================================== --- branches/v2_0_0/config.h.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/config.h.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -635,6 +635,8 @@ <inttypes.h> don't define. */ /* #undef uintmax_t */ +#define HAVE_LIBXML 1 + /* * Following are added for Win32 version of Gaim */ Modified: branches/v2_0_0/gaim-installer.nsi =================================================================== --- branches/v2_0_0/gaim-installer.nsi 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/gaim-installer.nsi 2006-06-08 15:20:38 UTC (rev 16236) @@ -744,6 +744,7 @@ Delete "$INSTDIR\idletrack.dll" Delete "$INSTDIR\libgtkspell.dll" Delete "$INSTDIR\libmeanwhile-1.dll" + Delete "$INSTDIR\libxml2.dll" Delete "$INSTDIR\nspr4.dll" Delete "$INSTDIR\nss3.dll" Delete "$INSTDIR\nssckbi.dll" Modified: branches/v2_0_0/src/Makefile.mingw =================================================================== --- branches/v2_0_0/src/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/src/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -18,6 +18,7 @@ GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir NSS_DIR := ../../win32-dev/nss-3.9 NSPR_DIR := ../../win32-dev/nspr-4.4.1 +LIBXML2_DIR := ../../win32-dev/libxml2 ## ## VARIABLE DEFINITIONS @@ -66,7 +67,8 @@ -I$(ASPELL_TOP)/include \ -I$(GTKSPELL_TOP) \ -I$(NSS_DIR)/include \ - -I$(NSPR_DIR)/include + -I$(NSPR_DIR)/include \ + -I$(LIBXML2_DIR)/include LIB_PATHS = -L$(GTK_TOP)/lib \ @@ -74,7 +76,8 @@ -L$(IDLETRACK_TOP) \ -L$(ASPELL_TOP)/lib \ -L$(NSS_DIR)/lib \ - -L$(NSPR_DIR)/lib + -L$(NSPR_DIR)/lib \ + -L$(LIBXML2_DIR)/lib ## ## SOURCES, OBJECTS @@ -191,8 +194,8 @@ -lidletrack \ -lnss3 \ -lnspr4 \ - -lssl3 - + -lssl3 \ + -lxml2 EXE_LIBS = Modified: branches/v2_0_0/src/protocols/jabber/Makefile.mingw =================================================================== --- branches/v2_0_0/src/protocols/jabber/Makefile.mingw 2006-06-08 15:19:56 UTC (rev 16235) +++ branches/v2_0_0/src/protocols/jabber/Makefile.mingw 2006-06-08 15:20:38 UTC (rev 16236) @@ -10,6 +10,7 @@ INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 +LIBXML2_DIR:= ../../../../win32-dev/libxml2 GAIM_TOP := ../../.. JABBER_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -50,18 +51,16 @@ INCLUDE_PATHS += -I$(JABBER_ROOT) \ -I$(JABBER_ROOT)/win32 \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ + -I$(LIBXML2_DIR)/include \ -I$(GAIM_TOP)/src \ -I$(GAIM_TOP)/src/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ + -L$(LIBXML2_DIR)/lib \ -L$(GAIM_TOP)/src @@ -93,11 +92,9 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ + -lxml2 \ -lws2_32 \ -lintl \ -lgaim This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-11 19:08:19
|
Revision: 16258 Author: rlaager Date: 2006-06-11 12:08:12 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16258&view=rev Log Message: ----------- Merging my last two days' changes from trunk to v2_0_0. In case anyone else is having trouble figuring it out, merges in SVN are apparently handled like this: svn merge -r 16256:16257 https://svn.sourceforge.net/svnroot/gaim/trunk/src/gtkdialogs.c src/gtkdialogs.c Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/pixmaps/smileys/THEMES-HOWTO branches/v2_0_0/src/gtkblist.c branches/v2_0_0/src/gtkdialogs.c Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-06-11 19:05:45 UTC (rev 16257) +++ branches/v2_0_0/configure.ac 2006-06-11 19:08:12 UTC (rev 16258) @@ -318,8 +318,8 @@ dnl ####################################################################### dnl # Check for Gadu-Gadu client includes and libraries dnl ####################################################################### -AC_ARG_WITH(gadu-includes, [AC_HELP_STRING([--with-gadu-includes=DIR], [compile the GaduGadu plugin against includes in DIR])], [ac_gadu_includes="$withval"], [ac_gadu_includes="no"]) -AC_ARG_WITH(gadu-libs, [AC_HELP_STRING([--with-gadu-libs=DIR], [compile the GaduGadu plugin against the libs in DIR])], [ac_gadu_libs="$withval"], [ac_gadu_libs="no"]) +AC_ARG_WITH(gadu-includes, [AC_HELP_STRING([--with-gadu-includes=DIR], [compile the Gadu-Gadu plugin against includes in DIR])], [ac_gadu_includes="$withval"], [ac_gadu_includes="no"]) +AC_ARG_WITH(gadu-libs, [AC_HELP_STRING([--with-gadu-libs=DIR], [compile the Gadu-Gadu plugin against the libs in DIR])], [ac_gadu_libs="$withval"], [ac_gadu_libs="no"]) GADU_CFLAGS="" GADU_LIBS="" if test -n "$with_gadu_includes" || test -n "$with_gadu_libs"; then @@ -1072,7 +1072,7 @@ dnl These two are inverses of each other <-- stolen from evolution! AC_ARG_ENABLE(gnutls, - [ --enable-gnutls=[yes,no] attempt to use GNUTLS for SSL support (preferred) [default=yes]], + [ --enable-gnutls=[yes,no] attempt to use GnuTLS for SSL support (preferred) [default=yes]], [enable_gnutls="$enableval"], [enable_gnutls="yes"]) @@ -1084,14 +1084,14 @@ msg_ssl="None (MSN will not work without SSL!)" dnl # -dnl # Check for GNUTLS if it's specified. +dnl # Check for GnuTLS if it's specified. dnl # if test "x$enable_gnutls" != "xno"; then enable_gnutls="no" prefix=`eval echo $prefix` AC_ARG_WITH(gnutls-includes, - [ --with-gnutls-includes=PREFIX location of GNUTLS includes.], + [ --with-gnutls-includes=PREFIX location of GnuTLS includes.], [ with_gnutls_includes="$withval" ], [ with_gnutls_includes="$prefix/include" ]) @@ -1100,7 +1100,7 @@ if test "x$with_gnutls_includes" != "xno"; then CPPFLAGS_save="$CPPFLAGS" - AC_MSG_CHECKING(for GNUTLS includes) + AC_MSG_CHECKING(for GnuTLS includes) AC_MSG_RESULT("") CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes" @@ -1116,12 +1116,12 @@ GNUTLS_CFLAGS="" fi else - AC_MSG_CHECKING(for GNUTLS includes) + AC_MSG_CHECKING(for GnuTLS includes) AC_MSG_RESULT(no) fi AC_ARG_WITH(gnutls-libs, - [ --with-gnutls-libs=PREFIX location of GNUTLS libraries.], + [ --with-gnutls-libs=PREFIX location of GnuTLS libraries.], [ with_gnutls_libs="$withval" ]) if test "x$with_gnutls_libs" != "xno" -a \ @@ -1134,7 +1134,7 @@ *) with_gnutls_libs="-L$with_gnutls_libs" ;; esac - AC_CACHE_CHECK([for GNUTLS libraries], gnutls_libs, + AC_CACHE_CHECK([for GnuTLS libraries], gnutls_libs, [ LDFLAGS="$LDFLAGS $with_gnutls_libs -lgnutls -lgcrypt" AC_TRY_LINK_FUNC(gnutls_init, gnutls_libs="yes", gnutls_libs="no") @@ -1142,9 +1142,9 @@ ]) if test "x$gnutls_libs" != "xno"; then - AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GNUTLS]) + AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GnuTLS]) AC_DEFINE(HAVE_SSL) - msg_gnutls="GNUTLS" + msg_gnutls="GnuTLS" GNUTLS_LIBS="$with_gnutls_libs -lgnutls -lgcrypt" enable_gnutls="yes" @@ -1153,7 +1153,7 @@ GNUTLS_LIBS="" fi else - AC_MSG_CHECKING(for GNUTLS libraries) + AC_MSG_CHECKING(for GnuTLS libraries) AC_MSG_RESULT(no) fi else @@ -1168,7 +1168,7 @@ dnl # -dnl # Check for NSS if it's specified, or if GNUTLS checks failed. +dnl # Check for NSS if it's specified, or if GnuTLS checks failed. dnl # if test "x$enable_nss" != "xno"; then Modified: branches/v2_0_0/pixmaps/smileys/THEMES-HOWTO =================================================================== --- branches/v2_0_0/pixmaps/smileys/THEMES-HOWTO 2006-06-11 19:05:45 UTC (rev 16257) +++ branches/v2_0_0/pixmaps/smileys/THEMES-HOWTO 2006-06-11 19:08:12 UTC (rev 16258) @@ -4,10 +4,8 @@ Version 0.60 of Gaim brings up all themable smileys. In the preferences dialog, a user can choose from a selection of looks his smileys will take. This guide is to serve as a reference to those interested in creating third-party smiley themes. -(SME: I'm doing this at 6:30AM; I'm tired, but I can't sleep. Someone make sure I fix this up to make sure it all makes sense when I'm not tired anymore. Right now it's mostly just unassembled thoughts) +Your theme should be contained in a single directory. This directory will be installed in the Gaim smiley theme directory ($HOME/.gaim/smileys/). This directory will contain a file called `theme' that specifies the theme metadata and image files that are used by the theme. The format of the `theme' file is as follows. -Your theme should be contained in a single directory. This directory will be installed in the Gaim smiley theme directory (SME: There should probably be a $HOME/.gaim/smileys/ that the theme could go in too.). This directory will contain a file called `theme' that specifies the theme and image (SME: And possibly sound) files that are used by the theme. The format of the `theme' file is as follows. - The beginning of the file contains some metainformation about the theme in the format Key=Value @@ -19,10 +17,16 @@ Author - The author's name Following this meta-information are "sml" groups. A "sml" group is a group of smileys that will be shown together. For example, each protocol has its own "sml" group (MSN, Yahoo, Gadu-Gadu, etc.). The name of the group is surrounded in square brackets, and each line beneath it (until the next sml group or the end of the file) defines a smiley. -Each line of the group starts with a filename of the icon (SME: Or sound?) followed by a space-delimited list of the characters that represent it. +Each line of the group starts with a filename of the icon followed by a space-delimited list of the characters that represent it. Example: [AIM/ICQ] smiley.png :) :-) In the smiley selector UI, each icon will only be shown once, and the first string representing it will be used. To keep a smiley out of the selector altogether, make the first two characters of the line "! " followed by the filename and emoticons. + +As of 2.0.0beta2, spaces and backslashes in the "list of characters" (see above) must be escaped by prepending them with a backslash. For example, to define a smiley that is represented by ":-/" and ":-\", use: + +[AIM/ICQ] +think.png :-/ :-\\ + Modified: branches/v2_0_0/src/gtkblist.c =================================================================== --- branches/v2_0_0/src/gtkblist.c 2006-06-11 19:05:45 UTC (rev 16257) +++ branches/v2_0_0/src/gtkblist.c 2006-06-11 19:08:12 UTC (rev 16258) @@ -4162,10 +4162,7 @@ ihrs = (t - idle_secs) / 3600; imin = ((t - idle_secs) / 60) % 60; - if (ihrs > 0) - idle = g_strdup_printf("%d:%02d", ihrs, imin); - else - idle = g_strdup_printf("%d", imin); + idle = g_strdup_printf("%d:%02d", ihrs, imin); } } Modified: branches/v2_0_0/src/gtkdialogs.c =================================================================== --- branches/v2_0_0/src/gtkdialogs.c 2006-06-11 19:05:45 UTC (rev 16257) +++ branches/v2_0_0/src/gtkdialogs.c 2006-06-11 19:08:12 UTC (rev 16258) @@ -798,6 +798,16 @@ gaim_request_field_group_add_field(group, field); field = gaim_request_field_account_new("account", _("_Account"), NULL); + + /* gaim_request_field_account_new() only sets a default value if you're + * connected, and it sets it from the list of connected accounts. Since + * we're going to set show_all here, it makes sense to use the first + * account, not the first connected account. */ + if (gaim_accounts_get_all() != NULL) { + gaim_request_field_account_set_default_value(field, gaim_accounts_get_all()->data); + gaim_request_field_account_set_value(field, gaim_accounts_get_all()->data); + } + gaim_request_field_set_type_hint(field, "account"); gaim_request_field_account_set_show_all(field, TRUE); gaim_request_field_set_visible(field, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-19 07:56:59
|
Revision: 16290 Author: rlaager Date: 2006-06-19 00:56:40 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16290&view=rev Log Message: ----------- Merge today's changes (through 16287) to HEAD to the 2.0.0 branch. Modified Paths: -------------- branches/v2_0_0/COPYRIGHT branches/v2_0_0/plugins/ChangeLog.API branches/v2_0_0/plugins/idle.c branches/v2_0_0/plugins/perl/common/Account.xs branches/v2_0_0/plugins/perl/common/Conversation.xs branches/v2_0_0/src/conversation.c branches/v2_0_0/src/conversation.h branches/v2_0_0/src/ft.c branches/v2_0_0/src/gtkblist.c branches/v2_0_0/src/gtkconv.c branches/v2_0_0/src/gtkconv.h branches/v2_0_0/src/gtkmain.c branches/v2_0_0/src/util.c branches/v2_0_0/src/xmlnode.c Modified: branches/v2_0_0/COPYRIGHT =================================================================== --- branches/v2_0_0/COPYRIGHT 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/COPYRIGHT 2006-06-19 07:56:40 UTC (rev 16290) @@ -51,6 +51,7 @@ Christophe Chapuis Ka-Hing Cheung Sadrul Habib Chowdhury +Brian Chu Arturo Cisneros, Jr. Vincas Ciziunas Jonathan Clark Modified: branches/v2_0_0/plugins/ChangeLog.API =================================================================== --- branches/v2_0_0/plugins/ChangeLog.API 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/plugins/ChangeLog.API 2006-06-19 07:56:40 UTC (rev 16290) @@ -173,6 +173,8 @@ * GAIM_MESSAGE_COLORIZE * user_data from gaim_notify_searchresults_new_rows and from notify_searchresults in GaimNotifyUiOps. + * gaim_conversation_get_send_history(), and send_history from + GaimConversation Added: * gaim_prefs_disconnect_by_handle() Modified: branches/v2_0_0/plugins/idle.c =================================================================== --- branches/v2_0_0/plugins/idle.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/plugins/idle.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -102,12 +102,13 @@ idle_all_action_ok(void *ignored, GaimRequestFields *fields) { GaimAccount *acct = NULL; - GList *l = gaim_accounts_get_all_active(); + GList *list, *iter; int tm = gaim_request_fields_get_integer(fields, "mins"); const char *prpl_id = NULL; - for(; l; l = l->next) { - acct = (GaimAccount *)(l->data); + list = gaim_accounts_get_all_active(); + for(iter = list; iter; iter = iter->next) { + acct = (GaimAccount *)(iter->data); if(acct) prpl_id = gaim_account_get_protocol_id(acct); @@ -122,6 +123,8 @@ idled_accts = g_list_append(idled_accts, acct); } } + + g_list_free(list); } static void Modified: branches/v2_0_0/plugins/perl/common/Account.xs =================================================================== --- branches/v2_0_0/plugins/perl/common/Account.xs 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/plugins/perl/common/Account.xs 2006-06-19 07:56:40 UTC (rev 16290) @@ -286,11 +286,13 @@ void gaim_accounts_get_all_active() PREINIT: - GList *l; + GList *list, *iter; PPCODE: - for (l = gaim_accounts_get_all_active(); l != NULL; l = l->next) { - XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); + list = gaim_accounts_get_all_active(); + for (iter = gaim_accounts_get_all_active(); iter != NULL; iter = iter->next) { + XPUSHs(sv_2mortal(gaim_perl_bless_object(iter->data, "Gaim::Account"))); } + g_list_free(list); Gaim::Account gaim_accounts_find(name, protocol) Modified: branches/v2_0_0/plugins/perl/common/Conversation.xs =================================================================== --- branches/v2_0_0/plugins/perl/common/Conversation.xs 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/plugins/perl/common/Conversation.xs 2006-06-19 07:56:40 UTC (rev 16290) @@ -46,16 +46,6 @@ PROTOTYPES: ENABLE void -gaim_conversation_get_send_history(conv) - Gaim::Conversation conv -PREINIT: - GList *l; -PPCODE: - for (l = gaim_conversation_get_send_history(conv); l != NULL; l = l->next) { - XPUSHs(sv_2mortal(newSVpv(l->data, 0))); - } - -void gaim_conversation_destroy(conv) Gaim::Conversation conv Modified: branches/v2_0_0/src/conversation.c =================================================================== --- branches/v2_0_0/src/conversation.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/conversation.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -263,7 +263,6 @@ conv->account = account; conv->name = g_strdup(name); conv->title = g_strdup(name); - conv->send_history = g_list_append(NULL, NULL); conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); /* copy features from the connection. */ @@ -419,17 +418,6 @@ conv->name = NULL; conv->title = NULL; - for (node = g_list_first(conv->send_history); - node != NULL; - node = g_list_next(node)) { - - if (node->data != NULL) - g_free(node->data); - node->data = NULL; - } - - g_list_free(g_list_first(conv->send_history)); - if (conv->type == GAIM_CONV_TYPE_IM) { gaim_conv_im_stop_typing_timeout(conv->u.im); gaim_conv_im_stop_type_again_timeout(conv->u.im); @@ -708,14 +696,6 @@ conv->logs = NULL; } -GList * -gaim_conversation_get_send_history(const GaimConversation *conv) -{ - g_return_val_if_fail(conv != NULL, NULL); - - return conv->send_history; -} - GaimConvIm * gaim_conversation_get_im_data(const GaimConversation *conv) { Modified: branches/v2_0_0/src/conversation.h =================================================================== --- branches/v2_0_0/src/conversation.h 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/conversation.h 2006-06-19 07:56:40 UTC (rev 16290) @@ -236,8 +236,6 @@ GList *logs; /**< This conversation's logs */ - GList *send_history; /**< The send history. */ - union { GaimConvIm *im; /**< IM-specific data. */ @@ -441,15 +439,6 @@ void gaim_conversation_close_logs(GaimConversation *conv); /** - * Returns the specified conversation's send history. - * - * @param conv The conversation. - * - * @return The conversation's send history. - */ -GList *gaim_conversation_get_send_history(const GaimConversation *conv); - -/** * Returns the specified conversation's IM-specific data. * * If the conversation type is not GAIM_CONV_TYPE_IM, this will return @c NULL. Modified: branches/v2_0_0/src/ft.c =================================================================== --- branches/v2_0_0/src/ft.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/ft.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -388,8 +388,9 @@ gaim_xfer_get_status(xfer) == GAIM_XFER_STATUS_ACCEPTED) { gchar* message = NULL; + GaimBuddy *buddy = gaim_find_buddy(xfer->account, xfer->who); message = g_strdup_printf(_("%s is offering to send file %s"), - xfer->who, gaim_xfer_get_filename(xfer)); + buddy ? gaim_buddy_get_alias(buddy) : xfer->who, gaim_xfer_get_filename(xfer)); gaim_xfer_conversation_write(xfer, message, FALSE); g_free(message); /* Ask for a filename to save to if it's not already given by a plugin */ Modified: branches/v2_0_0/src/gtkblist.c =================================================================== --- branches/v2_0_0/src/gtkblist.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/gtkblist.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -1659,6 +1659,11 @@ static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, guint info, guint t) { + if (gtkblist->drag_timeout) { + g_source_remove(gtkblist->drag_timeout); + gtkblist->drag_timeout = 0; + } + if (sd->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE) && sd->data) { GaimBlistNode *n = NULL; GtkTreePath *path = NULL; Modified: branches/v2_0_0/src/gtkconv.c =================================================================== --- branches/v2_0_0/src/gtkconv.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/gtkconv.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -427,18 +427,14 @@ } static void -send_history_add(GaimConversation *conv, const char *message) +send_history_add(GaimGtkConversation *gtkconv, const char *message) { GList *first; - first = g_list_first(conv->send_history); - - if (first->data) - g_free(first->data); - + first = g_list_first(gtkconv->send_history); + g_free(first->data); first->data = g_strdup(message); - - conv->send_history = g_list_prepend(first, NULL); + gtkconv->send_history = g_list_prepend(first, NULL); } static gboolean @@ -462,7 +458,7 @@ GtkTextIter end; send_history = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); - send_history_add(conv, send_history); + send_history_add(gtkconv, send_history); g_free(send_history); cmdline = cmd + strlen(prefix); @@ -562,7 +558,7 @@ bufs = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->entry)); for (i = 0; bufs[i]; i++) { - send_history_add(conv, bufs[i]); + send_history_add(gtkconv, bufs[i]); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) gaim_conv_im_send_with_flags(GAIM_CONV_IM(conv), bufs[i], flags); else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) @@ -572,7 +568,7 @@ g_strfreev(bufs); } else { - send_history_add(conv, buf); + send_history_add(gtkconv, buf); if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) gaim_conv_im_send_with_flags(GAIM_CONV_IM(conv), buf, flags); else if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) @@ -1787,29 +1783,28 @@ if (event->state & GDK_CONTROL_MASK) { switch (event->keyval) { case GDK_Up: - if (!conv->send_history) + if (!gtkconv->send_history) break; - if (!conv->send_history->prev) { + if (!gtkconv->send_history->prev) { GtkTextIter start, end; - if (conv->send_history->data) - g_free(conv->send_history->data); + g_free(gtkconv->send_history->data); gtk_text_buffer_get_start_iter(gtkconv->entry_buffer, &start); gtk_text_buffer_get_end_iter(gtkconv->entry_buffer, &end); - conv->send_history->data = + gtkconv->send_history->data = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); } - if (conv->send_history->next && conv->send_history->next->data) { + if (gtkconv->send_history->next && gtkconv->send_history->next->data) { GObject *object; GtkTextIter iter; GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); - conv->send_history = conv->send_history->next; + gtkconv->send_history = gtkconv->send_history->next; /* Block the signal to prevent application of default formatting. */ object = g_object_ref(G_OBJECT(gtkconv->entry)); @@ -1824,7 +1819,7 @@ gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); gtk_imhtml_append_text_with_images( - GTK_IMHTML(gtkconv->entry), conv->send_history->data, + GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data, 0, NULL); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ @@ -1836,15 +1831,15 @@ break; case GDK_Down: - if (!conv->send_history) + if (!gtkconv->send_history) break; - if (conv->send_history->prev && conv->send_history->prev->data) { + if (gtkconv->send_history->prev && gtkconv->send_history->prev->data) { GObject *object; GtkTextIter iter; GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry)); - conv->send_history = conv->send_history->prev; + gtkconv->send_history = gtkconv->send_history->prev; /* Block the signal to prevent application of default formatting. */ object = g_object_ref(G_OBJECT(gtkconv->entry)); @@ -1859,11 +1854,11 @@ gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); gtk_imhtml_append_text_with_images( - GTK_IMHTML(gtkconv->entry), conv->send_history->data, + GTK_IMHTML(gtkconv->entry), gtkconv->send_history->data, 0, NULL); /* this is mainly just a hack so the formatting at the * cursor gets picked up. */ - if (*(char *)conv->send_history->data) { + if (*(char *)gtkconv->send_history->data) { gtk_text_buffer_get_end_iter(buffer, &iter); gtk_text_buffer_move_mark_by_name(buffer, "insert", &iter); } else { @@ -4347,6 +4342,7 @@ conv->ui_data = gtkconv; gtkconv->active_conv = conv; gtkconv->convs = g_list_prepend(gtkconv->convs, conv); + gtkconv->send_history = g_list_append(NULL, NULL); /* Setup some initial variables. */ gtkconv->sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); @@ -4515,6 +4511,10 @@ gtk_object_sink(GTK_OBJECT(gtkconv->tooltips)); + gtkconv->send_history = g_list_first(gtkconv->send_history); + g_list_foreach(gtkconv->send_history, (GFunc)g_free, NULL); + g_list_free(gtkconv->send_history); + g_free(gtkconv); } Modified: branches/v2_0_0/src/gtkconv.h =================================================================== --- branches/v2_0_0/src/gtkconv.h 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/gtkconv.h 2006-06-19 07:56:40 UTC (rev 16290) @@ -114,6 +114,7 @@ { GaimConversation *active_conv; GList *convs; + GList *send_history; GaimGtkWindow *win; Modified: branches/v2_0_0/src/gtkmain.c =================================================================== --- branches/v2_0_0/src/gtkmain.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/gtkmain.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -432,6 +432,7 @@ char *opt_session_arg = NULL; int dologin_ret = -1; char *search_path; + GList *accounts; #ifdef HAVE_SIGNAL_H int sig_indx; /* for setting up signal catching */ sigset_t sigset; @@ -752,10 +753,14 @@ gaim_accounts_restore_current_statuses(); } - if (gaim_accounts_get_all_active() == NULL) + if ((accounts = gaim_accounts_get_all_active()) == NULL) { gaim_gtk_accounts_window_show(); } + else + { + g_list_free(accounts); + } #ifdef HAVE_STARTUP_NOTIFICATION startup_notification_complete(); Modified: branches/v2_0_0/src/util.c =================================================================== --- branches/v2_0_0/src/util.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/util.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -1342,7 +1342,7 @@ face = g_string_append_c(face, *q); q++; } - g_string_append_printf(style, "font-family: %s; ", face->str); + g_string_append_printf(style, "font-family: %s; ", g_strstrip(face->str)); g_string_free(face, TRUE); p = q; } else if(!g_ascii_strncasecmp(p, "size=", strlen("size="))) { @@ -1392,7 +1392,7 @@ pt->dest_tag = "span"; tags = g_list_prepend(tags, pt); if(style->len) - g_string_append_printf(xhtml, "<span style='%s'>", style->str); + g_string_append_printf(xhtml, "<span style='%s'>", g_strstrip(style->str)); else pt->ignore = TRUE; g_string_free(style, TRUE); @@ -1412,7 +1412,7 @@ color = g_string_append_c(color, *q); q++; } - g_string_append_printf(xhtml, "<span style='background: %s;'>", color->str); + g_string_append_printf(xhtml, "<span style='background: %s;'>", g_strstrip(color->str)); g_string_free(color, TRUE); if ((c = strchr(c, '>')) != NULL) c++; Modified: branches/v2_0_0/src/xmlnode.c =================================================================== --- branches/v2_0_0/src/xmlnode.c 2006-06-19 06:39:11 UTC (rev 16289) +++ branches/v2_0_0/src/xmlnode.c 2006-06-19 07:56:40 UTC (rev 16290) @@ -557,7 +557,9 @@ { struct _xmlnode_parser_data *xpd; xmlnode *ret; +#ifndef HAVE_LIBXML GMarkupParseContext *context; +#endif gsize real_size; g_return_val_if_fail(str != NULL, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-06-27 21:54:53
|
Revision: 16360 Author: eblanton Date: 2006-06-27 14:54:44 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16360&view=rev Log Message: ----------- IRC support for CTCP VERSION from Andrej Krivul?\196?\141?\195?\173k Modified Paths: -------------- branches/v2_0_0/ChangeLog branches/v2_0_0/src/protocols/irc/cmds.c branches/v2_0_0/src/protocols/irc/irc.h branches/v2_0_0/src/protocols/irc/parse.c Modified: branches/v2_0_0/ChangeLog =================================================================== --- branches/v2_0_0/ChangeLog 2006-06-27 16:29:17 UTC (rev 16359) +++ branches/v2_0_0/ChangeLog 2006-06-27 21:54:44 UTC (rev 16360) @@ -130,6 +130,7 @@ channel or change your nick * Added /nickserv, /memoserv, /chanserv and /operserv commands (Joao Luís Marques Pinto) + * Added CTCP VERSION via /version (Andrej Krivulčík) Jabber Features: * Support for SRV lookups Modified: branches/v2_0_0/src/protocols/irc/cmds.c =================================================================== --- branches/v2_0_0/src/protocols/irc/cmds.c 2006-06-27 16:29:17 UTC (rev 16359) +++ branches/v2_0_0/src/protocols/irc/cmds.c 2006-06-27 21:54:44 UTC (rev 16360) @@ -127,6 +127,21 @@ return 1; } +int irc_cmd_ctcp_version(struct irc_conn *irc, const char *cmd, const char *target, const char **args) +{ + char *buf; + + + if (!args || !args[0]) + return 0; + + buf = irc_format(irc, "vn:", "PRIVMSG", args[0], "\001VERSION\001"); + irc_send(irc, buf); + g_free(buf); + + return 0; +} + int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args) { char *buf; Modified: branches/v2_0_0/src/protocols/irc/irc.h =================================================================== --- branches/v2_0_0/src/protocols/irc/irc.h 2006-06-27 16:29:17 UTC (rev 16359) +++ branches/v2_0_0/src/protocols/irc/irc.h 2006-06-27 21:54:44 UTC (rev 16360) @@ -152,6 +152,7 @@ int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_cmd_ctcp_action(struct irc_conn *irc, const char *cmd, const char *target, const char **args); +int irc_cmd_ctcp_version(struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args); int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); Modified: branches/v2_0_0/src/protocols/irc/parse.c =================================================================== --- branches/v2_0_0/src/protocols/irc/parse.c 2006-06-27 16:29:17 UTC (rev 16359) +++ branches/v2_0_0/src/protocols/irc/parse.c 2006-06-27 21:54:44 UTC (rev 16360) @@ -140,6 +140,7 @@ { "time", "", irc_cmd_time, N_("time: Displays the current local time at the IRC server.") }, { "topic", ":", irc_cmd_topic, N_("topic [new topic]: View or change the channel topic.") }, { "umode", ":", irc_cmd_mode, N_("umode <+|-><A-Za-z>: Set or unset a user mode.") }, + { "version", ":", irc_cmd_ctcp_version, N_("version [nick]: send CTCP VERSION request to a user") }, { "voice", ":", irc_cmd_op, N_("voice <nick1> [nick2] ...: Grant channel voice status to someone. You must be a channel operator to do this.") }, { "wallops", ":", irc_cmd_wallops, N_("wallops <message>: If you don't know what this is, you probably can't use it.") }, { "whois", "tt", irc_cmd_whois, N_("whois [server] <nick>: Get information on a user.") }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 22:36:24
|
Revision: 16392 Author: thekingant Date: 2006-07-01 15:36:21 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16392&view=rev Log Message: ----------- Backport SVN revision #16390 and 16391 from HEAD to v2_0_0 Original commit message: A small part of sf patch #1490646, from Jonty Wareing & Jono Cole "Fix & Enhance the Bonjour prpl" "Several instances of "magic strings" have been replaced with proper XML parsing code in the Bonjour prpl, allowing it to communicate with other Gaim clients (a misplaced space in one of the strings prevented this), and every other Bonjour chat client we can find. A fair amount of completely redundant code was also stripped, which in combination with the proper XML parsing allows the client to be far more flexible about Jabber errors in other clients." ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16390&view=rev Modified Paths: -------------- branches/v2_0_0/COPYRIGHT branches/v2_0_0/src/protocols/bonjour/jabber.c branches/v2_0_0/src/protocols/bonjour/jabber.h Modified: branches/v2_0_0/COPYRIGHT =================================================================== --- branches/v2_0_0/COPYRIGHT 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/COPYRIGHT 2006-07-01 22:36:21 UTC (rev 16392) @@ -59,6 +59,7 @@ Eoin Coffey Jason Cohen Todd Cohen +Jono Cole Nathan Conrad Felipe Contreras Alex Converse @@ -302,6 +303,7 @@ Wan Hing Wah Philip Walford Nathan Walp +Jonty Wareing Eric Warmenhoven Adam J. Warrington Andrew Wellington Modified: branches/v2_0_0/src/protocols/bonjour/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 22:36:21 UTC (rev 16392) @@ -309,6 +309,7 @@ char *closed_conv_message; BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; gboolean closed_conversation = FALSE; + xmlnode *message_node = NULL; /* Read the data from the socket */ if ((message_length = _read_data(socket, &message)) == -1) { @@ -325,34 +326,39 @@ } } - /* Check if the start of the doctype has been received, if not check that the current */ - /* data is the doctype */ - if (!(bb->conversation->start_step_one)) - { - if (g_str_has_prefix(message, DOCTYPE_DECLARATION)) - { - bb->conversation->start_step_one = TRUE; - } - } + /* Parse the message into an XMLnode for analysis */ + message_node = xmlnode_from_str(message, strlen(message)); /* Check if the start of the stream has been received, if not check that the current */ /* data is the start of the stream */ - if (!(bb->conversation->start_step_two)) + if (!(bb->conversation->stream_started)) { - if (g_str_has_suffix(message, STREAM_START)) { - bb->conversation->start_step_two = TRUE; - - /* If we haven't done it yet, we have to sent the start of the stream to the other buddy */ - if (!(bb->conversation->stream_started)) { - if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) { - gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); - } + /* Check if this is the start of the stream */ + if ((message_node != NULL) && + g_ascii_strcasecmp(xmlnode_get_attrib(message_node, "xmlns"), "jabber:client") && + (xmlnode_get_attrib(message_node,"xmlns:stream") != NULL)) + { + bb->conversation->stream_started = TRUE; + } + else + { + /* TODO: This needs to be nonblocking! */ + if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) + { + gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); } + else + { + bb->conversation->stream_started = TRUE; + } } - return; } - /* Check that this is not the end of the conversation */ + /* + * Check that this is not the end of the conversation. This is + * using a magic string, but xmlnode won't play nice when just + * parsing an end tag + */ if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { @@ -372,6 +378,8 @@ /* Parse the message to get the data and send to the ui */ _jabber_parse_and_write_message_to_ui(message, account->gc, gb); } + + xmlnode_free(message_node); } static void @@ -419,8 +427,6 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = client_socket; - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->message_id = 1; @@ -553,12 +559,10 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = _connect_to_buddy(gb); - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->watcher_id = gaim_input_add(bb->conversation->socket, - GAIM_INPUT_READ, _client_socket_handler, gb); + GAIM_INPUT_READ, _client_socket_handler, gb); } /* Check if the stream for the conversation has been started */ Modified: branches/v2_0_0/src/protocols/bonjour/jabber.h =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.h 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/src/protocols/bonjour/jabber.h 2006-07-01 22:36:21 UTC (rev 16392) @@ -28,11 +28,8 @@ #include "account.h" -#define DOCTYPE_DECLARATION "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" -#define STREAM_START "<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" -#define CONVERSATION_START "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" #define STREAM_END "</stream:stream>" -#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" >" +#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" typedef struct _BonjourJabber { @@ -47,8 +44,6 @@ gint socket; gint watcher_id; gchar* buddy_name; - gboolean start_step_one; - gboolean start_step_two; gboolean stream_started; gint message_id; } BonjourJabberConversation; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-07-29 05:36:33
|
Revision: 16593 Author: rlaager Date: 2006-07-28 22:36:23 -0700 (Fri, 28 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16593&view=rev Log Message: ----------- Merge the time_t -> struct tm changes from trunk into v2_0_0. Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/doc/gtkconv-signals.dox branches/v2_0_0/doc/log-signals.dox branches/v2_0_0/plugins/timestamp_format.c branches/v2_0_0/src/gtkconv.c branches/v2_0_0/src/log.c branches/v2_0_0/src/signals.c branches/v2_0_0/src/signals.h branches/v2_0_0/src/value.h Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/configure.ac 2006-07-29 05:36:23 UTC (rev 16593) @@ -60,6 +60,9 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_STRUCT_TM +AC_CHECK_SIZEOF(time_t, ,[ +#include <stdio.h> +#include <time.h>]) AC_C_BIGENDIAN Modified: branches/v2_0_0/doc/gtkconv-signals.dox =================================================================== --- branches/v2_0_0/doc/gtkconv-signals.dox 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/doc/gtkconv-signals.dox 2006-07-29 05:36:23 UTC (rev 16593) @@ -24,12 +24,12 @@ @signaldef conversation-timestamp @signalproto -char *(*conversation_timestamp)(GaimConversation *conv, struct tm *tm); +char *(*conversation_timestamp)(GaimConversation *conv, time_t when); @endsignalproto @signaldesc Emitted to allow plugins to customize the timestamp on a message. @param conv The conversation the message belongs to. - @param tm The time to be converted to a string. + @param when The time to be converted to a string. @return A textual representation of the time, or @c NULL to use a default format. @endsignaldef Modified: branches/v2_0_0/doc/log-signals.dox =================================================================== --- branches/v2_0_0/doc/log-signals.dox 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/doc/log-signals.dox 2006-07-29 05:36:23 UTC (rev 16593) @@ -8,13 +8,13 @@ @signaldef log-timestamp @signalproto -char *(*log_timestamp)(GaimConversation *conv, struct tm *tm); +char *(*log_timestamp)(GaimConversation *conv, time_t when); @endsignalproto @signaldesc Emitted to allow plugins to customize the timestamp on a message being logged. @param log The log the message belongs to. - @param tm The time to be converted to a string. + @param when The time to be converted to a string. @return A textual representation of the time, or @c NULL to use a default format. @note Plugins must be careful of logs with a type of GAIM_LOG_SYSTEM. Modified: branches/v2_0_0/plugins/timestamp_format.c =================================================================== --- branches/v2_0_0/plugins/timestamp_format.c 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/plugins/timestamp_format.c 2006-07-29 05:36:23 UTC (rev 16593) @@ -52,18 +52,18 @@ } static char *timestamp_cb_common(GaimConversation *conv, - const struct tm *tm, + time_t t, gboolean force, const char *dates) { + struct tm *tm = localtime(&t); g_return_val_if_fail(conv != NULL, NULL); - g_return_val_if_fail(tm != NULL, NULL); g_return_val_if_fail(dates != NULL, NULL); if (!strcmp(dates, "always") || (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && !strcmp(dates, "chats")) || - (time(NULL) > (mktime((struct tm *)tm) + 20*60))) + (time(NULL) > (mktime(tm) + 20*60))) { if (force) return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); @@ -78,7 +78,7 @@ } static char *conversation_timestamp_cb(GaimConversation *conv, - const struct tm *tm, gpointer data) + time_t t, gpointer data) { gboolean force = gaim_prefs_get_bool( "/plugins/gtk/timestamp_format/force_24hr"); @@ -86,13 +86,11 @@ "/plugins/gtk/timestamp_format/use_dates/conversation"); g_return_val_if_fail(conv != NULL, NULL); - g_return_val_if_fail(tm != NULL, NULL); - return timestamp_cb_common(conv, tm, force, dates); + return timestamp_cb_common(conv, t, force, dates); } -static char *log_timestamp_cb(GaimLog *log, - const struct tm *tm, gpointer data) +static char *log_timestamp_cb(GaimLog *log, time_t t, gpointer data) { gboolean force = gaim_prefs_get_bool( "/plugins/gtk/timestamp_format/force_24hr"); @@ -100,17 +98,18 @@ "/plugins/gtk/timestamp_format/use_dates/log"); g_return_val_if_fail(log != NULL, NULL); - g_return_val_if_fail(tm != NULL, NULL); if (log->type == GAIM_LOG_SYSTEM) { - if (force) + if (force) { + struct tm *tm = localtime(&t); return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); - else + } else { return NULL; + } } - return timestamp_cb_common(log->conv, tm, force, dates); + return timestamp_cb_common(log->conv, t, force, dates); } static gboolean Modified: branches/v2_0_0/src/gtkconv.c =================================================================== --- branches/v2_0_0/src/gtkconv.c 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/src/gtkconv.c 2006-07-29 05:36:23 UTC (rev 16593) @@ -4591,7 +4591,6 @@ GaimConversationType type; char *displaying; gboolean plugin_return; - struct tm tm; g_return_if_fail(conv != NULL); gtkconv = GAIM_GTK_CONVERSATION(conv); @@ -4676,16 +4675,16 @@ if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", gtk_font_options_all); - tm = *(localtime(&mtime)); mdate = gaim_signal_emit_return_1(gaim_gtk_conversations_get_handle(), "conversation-timestamp", - conv, &tm); + conv, mtime); if (mdate == NULL) { + struct tm *tm = localtime(&mtime); if (time(NULL) > mtime + 20*60) /* show date if older than 20 minutes */ - mdate = g_strdup(gaim_date_format_long(&tm)); + mdate = g_strdup(gaim_date_format_long(tm)); else - mdate = g_strdup(gaim_time_format(&tm)); + mdate = g_strdup(gaim_time_format(tm)); } sml_attrib = g_strdup_printf("sml=\"%s\"", gaim_account_get_protocol_name(account)); @@ -6450,11 +6449,23 @@ "GaimGtkWindow *")); gaim_signal_register(handle, "conversation-timestamp", - gaim_marshal_POINTER__POINTER_POINTER, +#if SIZEOF_TIME_T == 4 + gaim_marshal_POINTER__POINTER_INT, +#elif SIZEOF_TIME_T == 8 + gaim_marshal_POINTER__POINTER_INT64, +#else +# error Unknown size of time_t +#endif gaim_value_new(GAIM_TYPE_POINTER), 2, gaim_value_new(GAIM_TYPE_SUBTYPE, - GAIM_SUBTYPE_CONVERSATION), - gaim_value_new(GAIM_TYPE_POINTER)); + GAIM_SUBTYPE_LOG), +#if SIZEOF_TIME_T == 4 + gaim_value_new(GAIM_TYPE_INT)); +#elif SIZEOF_TIME_T == 8 + gaim_value_new(GAIM_TYPE_INT64)); +#else +# error Unknown size of time_t +#endif gaim_signal_register(handle, "displaying-im-msg", gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, Modified: branches/v2_0_0/src/log.c =================================================================== --- branches/v2_0_0/src/log.c 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/src/log.c 2006-07-29 05:36:23 UTC (rev 16593) @@ -593,12 +593,23 @@ gaim_log_logger_add(old_logger); gaim_signal_register(handle, "log-timestamp", - gaim_marshal_POINTER__POINTER_POINTER, +#if SIZEOF_TIME_T == 4 + gaim_marshal_POINTER__POINTER_INT, +#elif SIZEOF_TIME_T == 8 + gaim_marshal_POINTER__POINTER_INT64, +#else +# error Unknown size of time_t +#endif gaim_value_new(GAIM_TYPE_POINTER), 2, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_LOG), - gaim_value_new(GAIM_TYPE_BOXED, - "struct tm *")); +#if SIZEOF_TIME_T == 4 + gaim_value_new(GAIM_TYPE_INT)); +#elif SIZEOF_TIME_T == 8 + gaim_value_new(GAIM_TYPE_INT64)); +#else +# error Unknown size of time_t +#endif gaim_prefs_connect_callback(NULL, "/core/logging/format", logger_pref_cb, NULL); @@ -622,14 +633,15 @@ static char *log_get_timestamp(GaimLog *log, time_t when) { char *date; - struct tm tm = *(localtime(&when)); + struct tm tm; date = gaim_signal_emit_return_1(gaim_log_get_handle(), "log-timestamp", - log, &tm); + log, when); if (date != NULL) return date; + tm = *(localtime(&when)); if (log->type == GAIM_LOG_SYSTEM || time(NULL) > when + 20*60) return g_strdup(gaim_date_format_long(&tm)); else Modified: branches/v2_0_0/src/signals.c =================================================================== --- branches/v2_0_0/src/signals.c 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/src/signals.c 2006-07-29 05:36:23 UTC (rev 16593) @@ -955,6 +955,36 @@ } void +gaim_marshal_POINTER__POINTER_INT( + GaimCallback cb, va_list args, void *data, + void **return_val) +{ + gpointer ret_val; + void *arg1 = va_arg(args, void *); + gint arg2 = va_arg(args, gint); + + ret_val = ((gpointer(*)(void *, gint, void *))cb)(arg1, arg2, data); + + if (return_val != NULL) + *return_val = ret_val; +} + +void +gaim_marshal_POINTER__POINTER_INT64( + GaimCallback cb, va_list args, void *data, + void **return_val) +{ + gpointer ret_val; + void *arg1 = va_arg(args, void *); + gint64 arg2 = va_arg(args, gint64); + + ret_val = ((gpointer(*)(void *, gint64, void *))cb)(arg1, arg2, data); + + if (return_val != NULL) + *return_val = ret_val; +} + +void gaim_marshal_POINTER__POINTER_POINTER(GaimCallback cb, va_list args, void *data, void **return_val) { Modified: branches/v2_0_0/src/signals.h =================================================================== --- branches/v2_0_0/src/signals.h 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/src/signals.h 2006-07-29 05:36:23 UTC (rev 16593) @@ -327,6 +327,10 @@ void gaim_marshal_BOOLEAN__INT_POINTER( GaimCallback cb, va_list args, void *data, void **return_val); +void gaim_marshal_POINTER__POINTER_INT( + GaimCallback cb, va_list args, void *data, void **return_val); +void gaim_marshal_POINTER__POINTER_INT64( + GaimCallback cb, va_list args, void *data, void **return_val); void gaim_marshal_POINTER__POINTER_POINTER( GaimCallback cb, va_list args, void *data, void **return_val); /*@}*/ Modified: branches/v2_0_0/src/value.h =================================================================== --- branches/v2_0_0/src/value.h 2006-07-28 23:48:26 UTC (rev 16592) +++ branches/v2_0_0/src/value.h 2006-07-29 05:36:23 UTC (rev 16593) @@ -53,6 +53,7 @@ } GaimType; + /** * Gaim-specific subtype values. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-03 09:19:12
|
Revision: 16627 Author: thekingant Date: 2006-08-03 02:19:10 -0700 (Thu, 03 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16627&view=rev Log Message: ----------- Backport SVN revision #16626 from HEAD to v2_0_0 Original commit message Hopefully load non-ASCII aliases from our SSI information correctly more often with AIM/ICQ. Mattias Eriksson helped with this patch ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16626&view=rev Modified Paths: -------------- branches/v2_0_0/COPYRIGHT branches/v2_0_0/src/protocols/oscar/oscar.c Modified: branches/v2_0_0/COPYRIGHT =================================================================== --- branches/v2_0_0/COPYRIGHT 2006-08-03 09:17:05 UTC (rev 16626) +++ branches/v2_0_0/COPYRIGHT 2006-08-03 09:19:10 UTC (rev 16627) @@ -86,6 +86,7 @@ Nelson Elhage Ignacio J. Elia Brian Enigma +Mattias Eriksson Stefan Esser Steffen Eschenbacher Marc Etcheverry Modified: branches/v2_0_0/src/protocols/oscar/oscar.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-03 09:17:05 UTC (rev 16626) +++ branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-03 09:19:10 UTC (rev 16627) @@ -4785,7 +4785,18 @@ char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, curitem->name); char *gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL; char *alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name); - char *alias_utf8 = alias ? oscar_utf8_try_convert(gc->account, alias) : NULL; + char *alias_utf8; + + if (alias != NULL) + { + if (g_utf8_validate(alias, -1, NULL)) + alias_utf8 = g_strdup(alias); + else + alias_utf8 = oscar_utf8_try_convert(account, alias); + } + else + alias_utf8 = NULL; + b = gaim_find_buddy(gc->account, curitem->name); /* Should gname be freed here? -- elb */ /* Not with the current code, but that might be cleaner -- med */ @@ -4945,8 +4956,18 @@ gname = aim_ssi_itemlist_findparentname(od->ssi.local, name); gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL; + alias = aim_ssi_getalias(od->ssi.local, gname, name); - alias_utf8 = alias ? oscar_utf8_try_convert(gc->account, alias) : NULL; + if (alias != NULL) + { + if (g_utf8_validate(alias, -1, NULL)) + alias_utf8 = g_strdup(alias); + else + alias_utf8 = oscar_utf8_try_convert(gaim_connection_get_account(gc), alias); + } + else + alias_utf8 = NULL; + b = gaim_find_buddy(gc->account, name); g_free(alias); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-05 09:54:49
|
Revision: 16645 Author: thekingant Date: 2006-08-05 02:54:33 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16645&view=rev Log Message: ----------- Backport SVN revisions 16638 through 16643 from HEAD to v2_0_0 Original commit messages: thekingant * r16638 /trunk/ (61 files in 4 dirs): A bunch of small changes. Mostly remove "if not null" checks before calling g_free, g_list_free, g_slist_free and g_strdup. Also use g_list_foreach() to call g_free to free strings in an array. And some whitespace changes here and there. thekingant * r16639 /trunk/doc/: Add doc/gntgaim.1 to the svn:ignore property thekingant * r16640 /trunk/ (8 files in 5 dirs): Remove the Napster PRPL thekingant * r16641 /trunk/src/ (gaim-socket.h socket.c): Remove the old src/gaim-socket.h and src/socket.c from Subversion thekingant * r16642 /trunk/src/ (mime.c mime.h): Formatting/whitespace thekingant * r16643 /trunk/src/ (gtkimhtml.c util.c): Return g_string_free(str, FALSE) directly instead of assigning str->str to a temporary directory and returning that. Modified Paths: -------------- branches/v2_0_0/ChangeLog branches/v2_0_0/Makefile.mingw branches/v2_0_0/configure.ac branches/v2_0_0/pixmaps/status/default/Makefile.am branches/v2_0_0/plugins/codeinline.c branches/v2_0_0/plugins/contact_priority.c branches/v2_0_0/plugins/dbus-example.c branches/v2_0_0/plugins/history.c branches/v2_0_0/plugins/log_reader.c branches/v2_0_0/plugins/timestamp.c branches/v2_0_0/po/POTFILES.in branches/v2_0_0/src/account.c branches/v2_0_0/src/accountopt.c branches/v2_0_0/src/blist.c branches/v2_0_0/src/buddyicon.c branches/v2_0_0/src/cipher.c branches/v2_0_0/src/cmds.c branches/v2_0_0/src/connection.c branches/v2_0_0/src/conversation.c branches/v2_0_0/src/core.c branches/v2_0_0/src/dbus-define-api.h branches/v2_0_0/src/dbus-server.h branches/v2_0_0/src/dbus-useful.c branches/v2_0_0/src/dbus-useful.h branches/v2_0_0/src/ft.c branches/v2_0_0/src/gaim-client-example.c branches/v2_0_0/src/gaim-client.c branches/v2_0_0/src/gtkaccount.c branches/v2_0_0/src/gtkblist.c branches/v2_0_0/src/gtkconv.c branches/v2_0_0/src/gtkdebug.c branches/v2_0_0/src/gtkft.c branches/v2_0_0/src/gtkimhtml.c branches/v2_0_0/src/gtkimhtmltoolbar.c branches/v2_0_0/src/gtklog.c branches/v2_0_0/src/gtkpluginpref.c branches/v2_0_0/src/gtkpounce.c branches/v2_0_0/src/gtkprefs.c branches/v2_0_0/src/gtkprivacy.c branches/v2_0_0/src/gtkrequest.c branches/v2_0_0/src/gtkroomlist.c branches/v2_0_0/src/gtksound.c branches/v2_0_0/src/gtkstatusbox.c branches/v2_0_0/src/gtkthemes.c branches/v2_0_0/src/gtkutils.c branches/v2_0_0/src/imgstore.c branches/v2_0_0/src/log.c branches/v2_0_0/src/mime.c branches/v2_0_0/src/mime.h branches/v2_0_0/src/notify.c branches/v2_0_0/src/plugin.c branches/v2_0_0/src/pluginpref.c branches/v2_0_0/src/pounce.c branches/v2_0_0/src/prefs.c branches/v2_0_0/src/protocols/Makefile.am branches/v2_0_0/src/protocols/oscar/oscar.c branches/v2_0_0/src/proxy.c branches/v2_0_0/src/prpl.c branches/v2_0_0/src/request.c branches/v2_0_0/src/roomlist.c branches/v2_0_0/src/server.c branches/v2_0_0/src/signals.c branches/v2_0_0/src/status.c branches/v2_0_0/src/util.c branches/v2_0_0/src/value.c branches/v2_0_0/src/whiteboard.c branches/v2_0_0/src/xmlnode.c Removed Paths: ------------- branches/v2_0_0/pixmaps/status/default/napster.png branches/v2_0_0/src/gaim-socket.h branches/v2_0_0/src/protocols/napster/ branches/v2_0_0/src/socket.c Property Changed: ---------------- branches/v2_0_0/doc/ branches/v2_0_0/plugins/codeinline.c Modified: branches/v2_0_0/ChangeLog =================================================================== --- branches/v2_0_0/ChangeLog 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/ChangeLog 2006-08-05 09:54:33 UTC (rev 16645) @@ -152,6 +152,7 @@ * SIP/SIMPLE support (Thomas Butter, Google Summer of Code) * Sametime protocol support Requires the meanwhile library: http://meanwhile.sourceforge.net + * Removed support for the napster and toc protocols Other Noteworthy Changes: * UPnP and NAT traversal support (Adam J. Warrington, Google Summer of Modified: branches/v2_0_0/Makefile.mingw =================================================================== --- branches/v2_0_0/Makefile.mingw 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/Makefile.mingw 2006-08-05 09:54:33 UTC (rev 16645) @@ -21,7 +21,6 @@ TOC = $(GAIM_PROTOS)/toc IRC = $(GAIM_PROTOS)/irc JABBER = $(GAIM_PROTOS)/jabber -NAPSTER = $(GAIM_PROTOS)/napster GG = $(GAIM_PROTOS)/gg NOVELL = $(GAIM_PROTOS)/novell SILC = $(GAIM_PROTOS)/silc Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/configure.ac 2006-08-05 09:54:33 UTC (rev 16645) @@ -1772,7 +1772,6 @@ src/protocols/irc/Makefile src/protocols/jabber/Makefile src/protocols/msn/Makefile - src/protocols/napster/Makefile src/protocols/novell/Makefile src/protocols/oscar/Makefile src/protocols/sametime/Makefile Property changes on: branches/v2_0_0/doc ___________________________________________________________________ Name: svn:ignore - Makefile.in Makefile html gaim.1 gaim-remote.1 + Makefile.in Makefile html gaim.1 gaim-remote.1 gntgaim.1 Modified: branches/v2_0_0/pixmaps/status/default/Makefile.am =================================================================== --- branches/v2_0_0/pixmaps/status/default/Makefile.am 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/pixmaps/status/default/Makefile.am 2006-08-05 09:54:33 UTC (rev 16645) @@ -26,7 +26,6 @@ male.png \ meanwhile.png \ msn.png \ - napster.png \ notauthorized.png \ novell.png \ occupied.png \ Deleted: branches/v2_0_0/pixmaps/status/default/napster.png =================================================================== (Binary files differ) Modified: branches/v2_0_0/plugins/codeinline.c =================================================================== --- branches/v2_0_0/plugins/codeinline.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/codeinline.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -48,12 +48,12 @@ static gboolean plugin_load(GaimPlugin *plugin) -{ +{ void *handle = gaim_conversations_get_handle(); plugin_handle = plugin; - gaim_signal_connect(handle, "writing-im-msg", plugin, + gaim_signal_connect(handle, "writing-im-msg", plugin, GAIM_CALLBACK(outgoing_msg_cb), NULL); - + return TRUE; } Property changes on: branches/v2_0_0/plugins/codeinline.c ___________________________________________________________________ Name: svn:executable - * Modified: branches/v2_0_0/plugins/contact_priority.c =================================================================== --- branches/v2_0_0/plugins/contact_priority.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/contact_priority.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -99,12 +99,12 @@ hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - + label = gtk_label_new_with_mnemonic(_(statuses[i].description)); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_size_group_add_widget(sg, label); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - + adj = gtk_adjustment_new(gaim_prefs_get_int(pref), -500, 500, 1, 1, 1); spin = gtk_spin_button_new((GtkAdjustment *)adj, 1, 0); g_signal_connect(G_OBJECT(spin), "value-changed", G_CALLBACK(pref_update), pref); Modified: branches/v2_0_0/plugins/dbus-example.c =================================================================== --- branches/v2_0_0/plugins/dbus-example.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/dbus-example.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -51,7 +51,7 @@ #include "dbus-bindings.h" typedef struct { - char *text; + char *text; } GaimText; /* This makes the structure GaimText visible to the gaim-dbus type @@ -59,7 +59,7 @@ on, we will be able to register pointers to structures of this type. You to dbus-define types you want to be directly accessible by external applications. */ -GAIM_DBUS_DEFINE_TYPE(GaimText) +GAIM_DBUS_DEFINE_TYPE(GaimText) /* Here we make four functions accessible to other applications by DBus. These functions can access types defined in gaim proper @@ -78,30 +78,30 @@ static GaimText hello; /* Here come the definitions of the four exported functions. */ -GaimText* dbus_example_get_hello_object(void) +GaimText* dbus_example_get_hello_object(void) { - return &hello; + return &hello; } -void dbus_example_set_text(GaimText *obj, const char *text) +void dbus_example_set_text(GaimText *obj, const char *text) { - if (obj != NULL) { - g_free(obj->text); - obj->text = g_strdup(text); - } + if (obj != NULL) { + g_free(obj->text); + obj->text = g_strdup(text); + } } -const char *dbus_example_get_text(GaimText *obj) +const char *dbus_example_get_text(GaimText *obj) { - if (obj != NULL) - return obj->text; - else - return NULL; + if (obj != NULL) + return obj->text; + else + return NULL; } -const char *dbus_example_get_buddy_name(GaimBuddy *buddy) +const char *dbus_example_get_buddy_name(GaimBuddy *buddy) { - return gaim_buddy_get_name(buddy); + return gaim_buddy_get_name(buddy); } /* And now standard plugin stuff */ @@ -111,33 +111,33 @@ { GAIM_DBUS_RETURN_FALSE_IF_DISABLED(plugin); - /* First, we have to register our four exported functions with the - main gaim dbus loop. Without this statement, the gaim dbus - code wouldn't know about our functions. */ - GAIM_DBUS_REGISTER_BINDINGS(plugin); + /* First, we have to register our four exported functions with the + main gaim dbus loop. Without this statement, the gaim dbus + code wouldn't know about our functions. */ + GAIM_DBUS_REGISTER_BINDINGS(plugin); - /* Then, we register the hello object of type GaimText. Note that - pointer registrations / unregistrations are completely dynamic; - they don't have to be made when the plugin is loaded / - unloaded. Without this statement the dbus gaim code wouldn't - know about the hello object. */ - GAIM_DBUS_REGISTER_POINTER(&hello, GaimText); + /* Then, we register the hello object of type GaimText. Note that + pointer registrations / unregistrations are completely dynamic; + they don't have to be made when the plugin is loaded / + unloaded. Without this statement the dbus gaim code wouldn't + know about the hello object. */ + GAIM_DBUS_REGISTER_POINTER(&hello, GaimText); - hello.text = g_strdup("Hello."); - - return TRUE; + hello.text = g_strdup("Hello."); + + return TRUE; } static gboolean plugin_unload(GaimPlugin *plugin) { - g_free(hello.text); + g_free(hello.text); - /* It is necessary to unregister all pointers registered by the module. */ - GAIM_DBUS_UNREGISTER_POINTER(&hello); + /* It is necessary to unregister all pointers registered by the module. */ + GAIM_DBUS_UNREGISTER_POINTER(&hello); - return TRUE; + return TRUE; } static GaimPluginInfo info = Modified: branches/v2_0_0/plugins/history.c =================================================================== --- branches/v2_0_0/plugins/history.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/history.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -90,7 +90,7 @@ if (logs == NULL) logs = gaim_log_get_logs(GAIM_LOG_IM, name, account); else - logs = g_list_sort(logs, gaim_log_compare); + logs = g_list_sort(logs, gaim_log_compare); } else if (convtype == GAIM_CONV_TYPE_CHAT) { Modified: branches/v2_0_0/plugins/log_reader.c =================================================================== --- branches/v2_0_0/plugins/log_reader.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/log_reader.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -300,7 +300,7 @@ if (!data->path || stat(data->path, &st)) st.st_size = 0; - + return st.st_size; } @@ -399,7 +399,7 @@ g_return_val_if_fail(log != NULL, g_strdup("")); data = log->logger_data; - + /* TODO: Do something here. */ return g_strdup(""); } Modified: branches/v2_0_0/plugins/timestamp.c =================================================================== --- branches/v2_0_0/plugins/timestamp.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/plugins/timestamp.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -120,7 +120,7 @@ gaim_conversation_set_data(conv, "timestamp-initialized", GINT_TO_POINTER(TRUE)); gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE)); gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE)); - gtk_text_buffer_create_tag (buffer, "TIMESTAMP", "foreground", "#888888", "justification", GTK_JUSTIFY_CENTER, + gtk_text_buffer_create_tag (buffer, "TIMESTAMP", "foreground", "#888888", "justification", GTK_JUSTIFY_CENTER, "weight", PANGO_WEIGHT_BOLD, NULL); do_timestamp(conv); } Modified: branches/v2_0_0/po/POTFILES.in =================================================================== --- branches/v2_0_0/po/POTFILES.in 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/po/POTFILES.in 2006-08-05 09:54:33 UTC (rev 16645) @@ -108,7 +108,6 @@ src/protocols/msn/state.c src/protocols/msn/switchboard.c src/protocols/msn/userlist.c -src/protocols/napster/napster.c src/protocols/novell/nmuser.c src/protocols/novell/novell.c src/protocols/oscar/flap_connection.c Modified: branches/v2_0_0/src/account.c =================================================================== --- branches/v2_0_0/src/account.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/account.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -792,8 +792,7 @@ { GaimAccountSetting *setting = (GaimAccountSetting *)data; - if (setting->ui != NULL) - g_free(setting->ui); + g_free(setting->ui); if (setting->type == GAIM_PREF_STRING) g_free(setting->value.string); @@ -1178,7 +1177,7 @@ g_return_if_fail(account != NULL); g_free(account->username); - account->username = (username == NULL ? NULL : g_strdup(username)); + account->username = g_strdup(username); schedule_accounts_save(); } @@ -1189,8 +1188,7 @@ g_return_if_fail(account != NULL); g_free(account->password); - account->password = NULL; - account->password = (password == NULL ? NULL : g_strdup(password)); + account->password = g_strdup(password); schedule_accounts_save(); } @@ -1212,7 +1210,7 @@ { char *old = account->alias; - account->alias = (alias == NULL ? NULL : g_strdup(alias)); + account->alias = g_strdup(alias); gaim_signal_emit(gaim_accounts_get_handle(), "account-alias-changed", account, old); g_free(old); @@ -1227,7 +1225,7 @@ g_return_if_fail(account != NULL); g_free(account->user_info); - account->user_info = (user_info == NULL ? NULL : g_strdup(user_info)); + account->user_info = g_strdup(user_info); schedule_accounts_save(); } @@ -1263,7 +1261,7 @@ } g_free(account->buddy_icon); - account->buddy_icon = (icon == NULL ? NULL : g_strdup(icon)); + account->buddy_icon = g_strdup(icon); if (gaim_account_is_connected(account)) { char *filename = gaim_buddy_icons_get_full_path(icon); @@ -1362,11 +1360,7 @@ /* Old with the old... */ if (account->status_types != NULL) { - GList *l; - - for (l = account->status_types; l != NULL; l = l->next) - gaim_status_type_destroy((GaimStatusType *)l->data); - + g_list_foreach(account->status_types, (GFunc)gaim_status_type_destroy, NULL); g_list_free(account->status_types); } Modified: branches/v2_0_0/src/accountopt.c =================================================================== --- branches/v2_0_0/src/accountopt.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/accountopt.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -87,8 +87,7 @@ if (option == NULL) return NULL; - if (default_value != NULL) - option->default_value.string = g_strdup(default_value); + option->default_value.string = g_strdup(default_value); return option; } @@ -159,10 +158,8 @@ g_return_if_fail(option != NULL); g_return_if_fail(option->type == GAIM_PREF_STRING); - if (option->default_value.string != NULL) - g_free(option->default_value.string); - - option->default_value.string = (value == NULL ? NULL : g_strdup(value)); + g_free(option->default_value.string); + option->default_value.string = g_strdup(value); } void @@ -310,8 +307,7 @@ split->text = g_strdup(text); split->field_sep = sep; - split->default_value = (default_value == NULL - ? NULL : g_strdup(default_value)); + split->default_value = g_strdup(default_value); return split; } @@ -321,12 +317,8 @@ { g_return_if_fail(split != NULL); - if (split->text != NULL) - g_free(split->text); - - if (split->default_value != NULL) - g_free(split->default_value); - + g_free(split->text); + g_free(split->default_value); g_free(split); } Modified: branches/v2_0_0/src/blist.c =================================================================== --- branches/v2_0_0/src/blist.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/blist.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -627,21 +627,21 @@ if (!gaim_account_is_connected(buddy->account)) continue; - if (new_priority == NULL) - new_priority = buddy; - else - { - int cmp; + if (new_priority == NULL) + new_priority = buddy; + else + { + int cmp; cmp = gaim_presence_compare(gaim_buddy_get_presence(new_priority), gaim_buddy_get_presence(buddy)); - if (cmp > 0 || (cmp == 0 && + if (cmp > 0 || (cmp == 0 && gaim_prefs_get_bool("/core/contact/last_match"))) - { - new_priority = buddy; - } - } + { + new_priority = buddy; + } + } } contact->priority = new_priority; @@ -1052,7 +1052,7 @@ /* Make a list of what the groups each buddy is in */ for(cur = buddies; cur; cur = cur->next) { GaimBlistNode *node = (GaimBlistNode *)cur->data; - groups = g_list_append(groups, node->parent->parent); + groups = g_list_prepend(groups, node->parent->parent); } gaim_account_remove_buddies(account, buddies, groups); @@ -2034,7 +2034,7 @@ const char *gaim_chat_get_name(GaimChat *chat) { struct proto_chat_entry *pce; - GList *parts, *tmp; + GList *parts; char *ret; g_return_val_if_fail(chat != NULL, NULL); @@ -2045,8 +2045,7 @@ parts = GAIM_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->chat_info(chat->account->gc); pce = parts->data; ret = g_hash_table_lookup(chat->components, pce->identifier); - for (tmp = parts; tmp; tmp = tmp->next) - g_free(tmp->data); + g_list_foreach(parts, (GFunc)g_free, NULL); g_list_free(parts); return ret; Modified: branches/v2_0_0/src/buddyicon.c =================================================================== --- branches/v2_0_0/src/buddyicon.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/buddyicon.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -312,7 +312,6 @@ g_return_if_fail(username != NULL); g_free(icon->username); - icon->username = g_strdup(username); } @@ -480,7 +479,6 @@ g_return_if_fail(dir != NULL); g_free(cache_dir); - cache_dir = g_strdup(dir); } Modified: branches/v2_0_0/src/cipher.c =================================================================== --- branches/v2_0_0/src/cipher.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/cipher.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -10,7 +10,7 @@ * * Original md4 taken from linux kernel * MD4 Message Digest Algorithm (RFC1320). - * + * * Implementation derived from Andrew Tridgell and Steve French's * CIFS MD4 implementation, and the cryptoapi implementation * originally based on the public domain implementation written @@ -26,16 +26,16 @@ * * des.c - DES and Triple-DES encryption/decryption Algorithm * Copyright (C) 1998 Free Software Foundation, Inc. - * + * * Please see below for more legal information! - * + * * According to the definition of DES in FIPS PUB 46-2 from December 1993. * For a description of triple encryption, see: * Bruce Schneier: Applied Cryptography. Second Edition. * John Wiley & Sons, 1996. ISBN 0-471-12845-7. Pages 358 ff. - * + * * This file is part of GnuPG. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or Modified: branches/v2_0_0/src/cmds.c =================================================================== --- branches/v2_0_0/src/cmds.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/cmds.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -71,9 +71,9 @@ c->args = g_strdup(args); c->priority = p; c->flags = f; - c->prpl_id = prpl_id ? g_strdup(prpl_id) : NULL; + c->prpl_id = g_strdup(prpl_id); c->func = func; - c->help = helpstr ? g_strdup(helpstr) : NULL; + c->help = g_strdup(helpstr); c->data = data; cmds = g_list_insert_sorted(cmds, c, (GCompareFunc)cmds_compare_func); @@ -85,11 +85,8 @@ { g_free(c->cmd); g_free(c->args); - if (c->prpl_id) - g_free(c->prpl_id); - if (c->help) - g_free(c->help); - + g_free(c->prpl_id); + g_free(c->help); g_free(c); } @@ -109,6 +106,10 @@ } } +/** + * This sets args to a NULL-terminated array of strings. It should + * be freed using g_strfreev(). + */ static gboolean gaim_cmd_parse_args(GaimCmd *cmd, const gchar *s, const gchar *m, gchar ***args) { int i; @@ -142,7 +143,7 @@ (*args)[i] = gaim_markup_slice(m, g_utf8_pointer_to_offset(s, cur), g_utf8_pointer_to_offset(s, end)); cur = end +1; } - break; + break; case 's': (*args)[i] = g_strdup(cur); cur = cur + strlen(cur); @@ -160,15 +161,6 @@ return TRUE; } -static void gaim_cmd_free_args(gchar **args) -{ - int i; - - for (i = 0; args[i]; i++) - g_free(args[i]); - g_free(args); -} - static void gaim_cmd_strip_current_char(gunichar c, char *s, guint len) { int bytes; @@ -260,7 +252,7 @@ /* this checks the allow bad args flag for us */ if (!gaim_cmd_parse_args(c, rest, mrest, &args)) { - gaim_cmd_free_args(args); + g_strfreev(args); args = NULL; continue; } @@ -268,10 +260,9 @@ tried_cmd = TRUE; ret = c->func(conv, cmd, args, &err, c->data); if (ret == GAIM_CMD_RET_CONTINUE) { - if (err) - g_free(err); + g_free(err); err = NULL; - gaim_cmd_free_args(args); + g_strfreev(args); args = NULL; continue; } else { @@ -280,8 +271,7 @@ } - if (args) - gaim_cmd_free_args(args); + g_strfreev(args); g_free(cmd); g_free(mrest); Modified: branches/v2_0_0/src/connection.c =================================================================== --- branches/v2_0_0/src/connection.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/connection.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -337,10 +337,8 @@ { g_return_if_fail(gc != NULL); - if (gc->display_name != NULL) - g_free(gc->display_name); - - gc->display_name = (name == NULL ? NULL : g_strdup(name)); + g_free(gc->display_name); + gc->display_name = g_strdup(name); } GaimConnectionState Modified: branches/v2_0_0/src/conversation.c =================================================================== --- branches/v2_0_0/src/conversation.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/conversation.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -335,7 +335,6 @@ GaimConversationUiOps *ops; GaimConnection *gc; const char *name; - GList *node; g_return_if_fail(conv != NULL); @@ -433,34 +432,22 @@ } else if (conv->type == GAIM_CONV_TYPE_CHAT) { - for (node = conv->u.chat->in_room; node != NULL; node = node->next) { - if (node->data != NULL) - gaim_conv_chat_cb_destroy((GaimConvChatBuddy *)node->data); - node->data = NULL; - } - - for (node = conv->u.chat->ignored; node != NULL; node = node->next) { - if (node->data != NULL) - g_free(node->data); - node->data = NULL; - } - + g_list_foreach(conv->u.chat->in_room, (GFunc)gaim_conv_chat_cb_destroy, NULL); g_list_free(conv->u.chat->in_room); + + g_list_foreach(conv->u.chat->ignored, (GFunc)g_free, NULL); g_list_free(conv->u.chat->ignored); conv->u.chat->in_room = NULL; conv->u.chat->ignored = NULL; - if (conv->u.chat->who != NULL) - g_free(conv->u.chat->who); + g_free(conv->u.chat->who); conv->u.chat->who = NULL; - if (conv->u.chat->topic != NULL) - g_free(conv->u.chat->topic); + g_free(conv->u.chat->topic); conv->u.chat->topic = NULL; - if(conv->u.chat->nick) - g_free(conv->u.chat->nick); + g_free(conv->u.chat->nick); GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat); g_free(conv->u.chat); @@ -587,9 +574,7 @@ g_return_if_fail(conv != NULL); g_return_if_fail(title != NULL); - if (conv->title != NULL) - g_free(conv->title); - + g_free(conv->title); conv->title = g_strdup(title); gaim_conversation_update(conv, GAIM_CONV_UPDATE_TITLE); @@ -651,11 +636,9 @@ { g_return_if_fail(conv != NULL); - if (conv->name != NULL) - g_free(conv->name); + g_free(conv->name); + conv->name = g_strdup(name); - conv->name = (name == NULL ? NULL : g_strdup(name)); - gaim_conversation_autoset_title(conv); } @@ -1326,11 +1309,11 @@ { g_return_if_fail(chat != NULL); - if (chat->who != NULL) g_free(chat->who); - if (chat->topic != NULL) g_free(chat->topic); + g_free(chat->who); + g_free(chat->topic); - chat->who = (who == NULL ? NULL : g_strdup(who)); - chat->topic = (topic == NULL ? NULL : g_strdup(topic)); + chat->who = g_strdup(who); + chat->topic = g_strdup(topic); gaim_conversation_update(gaim_conv_chat_get_conversation(chat), GAIM_CONV_UPDATE_TOPIC); @@ -1440,14 +1423,13 @@ g_list_free(flags2); } -int +static int gaim_conv_chat_cb_compare(GaimConvChatBuddy *a, GaimConvChatBuddy *b) { GaimConvChatBuddyFlags f1 = 0, f2 = 0; char *user1 = NULL, *user2 = NULL; gint ret = 0; - if (a) { f1 = a->flags; if (a->alias_key) @@ -1455,7 +1437,7 @@ else if (a->name) user1 = a->name; } - + if (b) { f2 = b->flags; if (b->alias_key) @@ -1470,7 +1452,7 @@ } else if (f1 != f2) { /* sort more important users first */ ret = (f1 > f2) ? -1 : 1; - } else if (a->buddy != b->buddy) { + } else if (a->buddy != b->buddy) { ret = a->buddy ? -1 : 1; } else { ret = strcasecmp(user1, user2); @@ -1565,7 +1547,7 @@ } cbuddies = g_list_sort(cbuddies, (GCompareFunc)gaim_conv_chat_cb_compare); - + if (ops != NULL && ops->chat_add_users != NULL) ops->chat_add_users(conv, cbuddies, new_arrivals); @@ -1728,7 +1710,7 @@ } /* NOTE: Don't remove them from ignored in case they re-enter. */ - + if (!quiet) { const char *alias = user; char *escaped; @@ -1866,8 +1848,7 @@ void gaim_conv_chat_set_nick(GaimConvChat *chat, const char *nick) { g_return_if_fail(chat != NULL); - if(chat->nick) - g_free(chat->nick); + g_free(chat->nick); chat->nick = g_strdup(gaim_normalize(chat->conv->account, nick)); } @@ -1920,10 +1901,7 @@ cb = g_new0(GaimConvChatBuddy, 1); cb->name = g_strdup(name); cb->flags = flags; - if (alias) - cb->alias = g_strdup(alias); - else - cb->alias = NULL; + cb->alias = g_strdup(alias); GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy); return cb; @@ -1950,11 +1928,12 @@ void gaim_conv_chat_cb_destroy(GaimConvChatBuddy *cb) { - g_return_if_fail(cb != NULL); + if (cb == NULL) + return; + g_free(cb->alias); + g_free(cb->alias_key); g_free(cb->name); - cb->name = NULL; - cb->flags = 0; GAIM_DBUS_UNREGISTER_POINTER(cb); g_free(cb); Modified: branches/v2_0_0/src/core.c =================================================================== --- branches/v2_0_0/src/core.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/core.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -196,11 +196,7 @@ gaim_dbus_uninit(); #endif - if (core->ui != NULL) { - g_free(core->ui); - core->ui = NULL; - } - + g_free(core->ui); g_free(core); _core = NULL; Modified: branches/v2_0_0/src/dbus-define-api.h =================================================================== --- branches/v2_0_0/src/dbus-define-api.h 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/dbus-define-api.h 2006-08-05 09:54:33 UTC (rev 16645) @@ -7,10 +7,10 @@ /* blist.h */ gboolean GAIM_BLIST_NODE_IS_CHAT(GaimBlistNode *node); -gboolean GAIM_BLIST_NODE_IS_BUDDY(GaimBlistNode *node); +gboolean GAIM_BLIST_NODE_IS_BUDDY(GaimBlistNode *node); gboolean GAIM_BLIST_NODE_IS_CONTACT(GaimBlistNode *node); gboolean GAIM_BLIST_NODE_IS_GROUP(GaimBlistNode *node); -gboolean GAIM_BUDDY_IS_ONLINE(GaimBuddy *buddy); +gboolean GAIM_BUDDY_IS_ONLINE(GaimBuddy *buddy); gboolean GAIM_BLIST_NODE_HAS_FLAG(GaimBlistNode *node, int flags); gboolean GAIM_BLIST_NODE_SHOULD_SAVE(GaimBlistNode *node); Modified: branches/v2_0_0/src/dbus-server.h =================================================================== --- branches/v2_0_0/src/dbus-server.h 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/dbus-server.h 2006-08-05 09:54:33 UTC (rev 16645) @@ -32,7 +32,7 @@ G_BEGIN_DECLS -/** +/** Types of pointers are identified by the ADDRESS of a GaimDbusType object. This way, plugins can easily access types defined in gaim proper as well as introduce their own types that will not conflict @@ -41,7 +41,7 @@ The structure GaimDbusType has only one element (GaimDBusType::parent), a contains a pointer to the parent type, or @c NULL if the type has no parent. Parent means the same as the base class in object oriented - programming. + programming. */ typedef struct _GaimDBusType GaimDBusType; @@ -98,7 +98,7 @@ In order for an object to participate in the scheme, it must register itself and its type with the engine. This registration allocates an integer id which can be resolved to the pointer and - back. + back. Handles are not persistent. They are reissued every time gaim is started. This is not good; external applications that use gaim @@ -108,14 +108,14 @@ Pointer registration is only a temporary solution. When GaimBuddy and similar structures have been converted into gobjects, this registration will be done automatically by objects themselves. - + By the way, this kind of object-handle translation should be so common that there must be a library (maybe even glib) that implements it. I feel a bit like reinventing the wheel here. */ void gaim_dbus_init_ids(void); -/** +/** Registers a typed pointer. @param node The pointer to register. @@ -123,7 +123,7 @@ */ void gaim_dbus_register_pointer(gpointer node, GaimDBusType *type); -/** +/** Unregisters a pointer previously registered with gaim_dbus_register_pointer. @@ -142,7 +142,7 @@ the types of the parameters. @param vargs A va_list containing the actual parameters. */ -void gaim_dbus_signal_emit_gaim(const char *name, int num_values, +void gaim_dbus_signal_emit_gaim(const char *name, int num_values, GaimValue **values, va_list vargs); /** @@ -191,7 +191,7 @@ #define DBUS_EXPORT -/* +/* Here we include the list of #GAIM_DBUS_DECLARE_TYPE statements for all structs defined in gaim. This file has been generated by the #dbus-analize-types.py script. Modified: branches/v2_0_0/src/dbus-useful.c =================================================================== --- branches/v2_0_0/src/dbus-useful.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/dbus-useful.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -7,47 +7,47 @@ GaimAccount * -gaim_accounts_find_ext(const char *name, const char *protocol_id, +gaim_accounts_find_ext(const char *name, const char *protocol_id, gboolean (*account_test)(const GaimAccount *account)) { - GaimAccount *result = NULL; - GList *l; - char *who; - - if (name) - who = g_strdup(gaim_normalize(NULL, name)); - else - who = NULL; - - for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { - GaimAccount *account = (GaimAccount *)l->data; - - if (who && strcmp(gaim_normalize(NULL, gaim_account_get_username(account)), who)) - continue; + GaimAccount *result = NULL; + GList *l; + char *who; - if (protocol_id && strcmp(account->protocol_id, protocol_id)) - continue; + if (name) + who = g_strdup(gaim_normalize(NULL, name)); + else + who = NULL; - if (account_test && !account_test(account)) - continue; + for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { + GaimAccount *account = (GaimAccount *)l->data; - result = account; - break; - } + if (who && strcmp(gaim_normalize(NULL, gaim_account_get_username(account)), who)) + continue; - g_free(who); + if (protocol_id && strcmp(account->protocol_id, protocol_id)) + continue; - return result; + if (account_test && !account_test(account)) + continue; + + result = account; + break; + } + + g_free(who); + + return result; } -GaimAccount *gaim_accounts_find_any(const char *name, const char *protocol) +GaimAccount *gaim_accounts_find_any(const char *name, const char *protocol) { - return gaim_accounts_find_ext(name, protocol, NULL); + return gaim_accounts_find_ext(name, protocol, NULL); } -GaimAccount *gaim_accounts_find_connected(const char *name, const char *protocol) +GaimAccount *gaim_accounts_find_connected(const char *name, const char *protocol) { - return gaim_accounts_find_ext(name, protocol, gaim_account_is_connected); + return gaim_accounts_find_ext(name, protocol, gaim_account_is_connected); } Modified: branches/v2_0_0/src/dbus-useful.h =================================================================== --- branches/v2_0_0/src/dbus-useful.h 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/dbus-useful.h 2006-08-05 09:54:33 UTC (rev 16645) @@ -1,6 +1,6 @@ #include "conversation.h" -GaimAccount *gaim_accounts_find_ext(const char *name, const char *protocol_id, +GaimAccount *gaim_accounts_find_ext(const char *name, const char *protocol_id, gboolean (*account_test)(const GaimAccount *account)); GaimAccount *gaim_accounts_find_any(const char *name, const char *protocol); Modified: branches/v2_0_0/src/ft.c =================================================================== --- branches/v2_0_0/src/ft.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/ft.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -648,11 +648,7 @@ g_return_if_fail(xfer != NULL); g_free(xfer->message); - - if (message != NULL) - xfer->message = g_strdup(message); - else - xfer->message = NULL; + xfer->message = g_strdup(message); } void @@ -660,10 +656,8 @@ { g_return_if_fail(xfer != NULL); - if (xfer->filename != NULL) - g_free(xfer->filename); - - xfer->filename = (filename == NULL ? NULL : g_strdup(filename)); + g_free(xfer->filename); + xfer->filename = g_strdup(filename); } void @@ -671,10 +665,8 @@ { g_return_if_fail(xfer != NULL); - if (xfer->local_filename != NULL) - g_free(xfer->local_filename); - - xfer->local_filename = (filename == NULL ? NULL : g_strdup(filename)); + g_free(xfer->local_filename); + xfer->local_filename = g_strdup(filename); } void Modified: branches/v2_0_0/src/gaim-client-example.c =================================================================== --- branches/v2_0_0/src/gaim-client-example.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gaim-client-example.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -5,7 +5,7 @@ #include "gaim-client.h" -/* +/* This example demonstrates how to use libgaim-client to communicate with gaim. The names and signatures of functions provided by libgaim-client are the same as those in gaim. However, all @@ -21,19 +21,19 @@ int main (int argc, char **argv) { - GList *alist, *node; + GList *alist, *node; - gaim_init(); - - alist = gaim_accounts_get_all(); - for (node = alist; node; node = node->next) { - GaimAccount *account = (GaimAccount*) node->data; - char *name = gaim_account_get_username(account); - g_print("Name: %s\n", name); - g_free(name); - } + gaim_init(); - g_list_free(alist); + alist = gaim_accounts_get_all(); + for (node = alist; node != NULL; node = node->next) + { + GaimAccount *account = (GaimAccount*) node->data; + char *name = gaim_account_get_username(account); + g_print("Name: %s\n", name); + g_free(name); + } + g_list_free(alist); - return 0; + return 0; } Modified: branches/v2_0_0/src/gaim-client.c =================================================================== --- branches/v2_0_0/src/gaim-client.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gaim-client.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -10,69 +10,72 @@ static DBusGConnection *bus; static DBusGProxy *gaim_proxy; -static GList *garray_int_to_glist(GArray *array) { - GList *list = NULL; - int i; +static GList *garray_int_to_glist(GArray *array) +{ + GList *list = NULL; + int i; - for(i = 0; i < array->len; i++) - list = g_list_append(list, GINT_TO_POINTER(g_array_index(array,gint,i))); + for (i = 0; i < array->len; i++) + list = g_list_append(list, GINT_TO_POINTER(g_array_index(array,gint,i))); - g_array_free(array, TRUE); - return list; + g_array_free(array, TRUE); + return list; } -static GSList *garray_int_to_gslist(GArray *array) { - GSList *list = NULL; - int i; +static GSList *garray_int_to_gslist(GArray *array) +{ + GSList *list = NULL; + int i; - for(i = 0; i < array->len; i++) - list = g_slist_append(list, GINT_TO_POINTER(g_array_index(array,gint,i))); + for (i = 0; i < array->len; i++) + list = g_slist_append(list, GINT_TO_POINTER(g_array_index(array,gint,i))); - g_array_free(array, TRUE); - return list; + g_array_free(array, TRUE); + return list; } #include "gaim-client-bindings.c" -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; +static void lose(const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); +static void lose_gerror(const char *prefix, GError *error) G_GNUC_NORETURN; static void -lose (const char *str, ...) +lose(const char *str, ...) { - va_list args; + va_list args; - va_start (args, str); + va_start(args, str); - vfprintf (stderr, str, args); - fputc ('\n', stderr); + vfprintf(stderr, str, args); + fputc('\n', stderr); - va_end (args); + va_end(args); - exit (1); + exit(1); } static void -lose_gerror (const char *prefix, GError *error) +lose_gerror(const char *prefix, GError *error) { - lose ("%s: %s", prefix, error->message); + lose("%s: %s", prefix, error->message); } -void gaim_init(void) { - GError *error = NULL; +void gaim_init(void) +{ + GError *error = NULL; - g_type_init (); + g_type_init (); - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + if (!bus) + lose_gerror ("Couldn't connect to session bus", error); - gaim_proxy = dbus_g_proxy_new_for_name (bus, - DBUS_SERVICE_GAIM, - DBUS_PATH_GAIM, - DBUS_INTERFACE_GAIM); + gaim_proxy = dbus_g_proxy_new_for_name (bus, + DBUS_SERVICE_GAIM, + DBUS_PATH_GAIM, + DBUS_INTERFACE_GAIM); - if (!gaim_proxy) - lose_gerror ("Couldn't connect to the Gaim Service", error); + if (!gaim_proxy) + lose_gerror ("Couldn't connect to the Gaim Service", error); } Deleted: branches/v2_0_0/src/gaim-socket.h =================================================================== --- branches/v2_0_0/src/gaim-socket.h 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gaim-socket.h 2006-08-05 09:54:33 UTC (rev 16645) @@ -1,45 +0,0 @@ -/* - * gaim-remote - * - * Gaim is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef _GAIM_GAIM_SOCKET_H_ -#define _GAIM_GAIM_SOCKET_H_ - -struct gaim_cui_packet { - guchar type; - guchar subtype; - guint32 length; - char *data; -}; - - -void cui_send_packet (int fd, struct gaim_cui_packet *p); -gint gaim_connect_to_session(gint session); -gboolean gaim_session_exists(int sess); - -struct gaim_cui_packet *cui_packet_new(guchar type, guchar subtype); -void cui_packet_free(struct gaim_cui_packet *p); -void cui_packet_append_string(struct gaim_cui_packet *p, char *str); -void cui_packet_append_char(struct gaim_cui_packet *p, char c); -void cui_packet_append_raw(struct gaim_cui_packet *p, char *str, int len); - - -#endif /* _GAIM_GAIM_SOCKET_H_ */ Modified: branches/v2_0_0/src/gtkaccount.c =================================================================== --- branches/v2_0_0/src/gtkaccount.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkaccount.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -204,7 +204,7 @@ gaim_gtk_buddy_icon_get_scale_size(pixbuf, &dialog->prpl_info->icon_spec, &width, &height); scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); - + g_object_unref(G_OBJECT(pixbuf)); pixbuf = scale; } @@ -231,9 +231,7 @@ { dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); - if (dialog->protocol_id != NULL) - g_free(dialog->protocol_id); - + g_free(dialog->protocol_id); dialog->protocol_id = g_strdup(dialog->plugin->info->id); } @@ -317,8 +315,7 @@ #endif /* FILECHOOSER */ - if (dialog->icon_path) - g_free(dialog->icon_path); + g_free(dialog->icon_path); dialog->icon_path = convert_buddy_icon(dialog->plugin, filename); set_dialog_icon(dialog); gtk_widget_show(dialog->icon_entry); @@ -482,8 +479,7 @@ static void icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) { - if (dialog->icon_path) - g_free(dialog->icon_path); + g_free(dialog->icon_path); dialog->icon_path = NULL; gtk_widget_hide(dialog->icon_entry); @@ -512,8 +508,7 @@ } if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) *rtmp = '\0'; - if (dialog->icon_path) - g_free(dialog->icon_path); + g_free(dialog->icon_path); dialog->icon_path = convert_buddy_icon(dialog->plugin, tmp); set_dialog_icon(dialog); gtk_widget_show(dialog->icon_entry); @@ -1423,15 +1418,10 @@ gtk_widget_destroy(dialog->window); - if (dialog->user_split_entries != NULL) - g_list_free(dialog->user_split_entries); + g_list_free(dialog->user_split_entries); + g_list_free(dialog->protocol_opt_entries); + g_free(dialog->protocol_id); - if (dialog->protocol_opt_entries != NULL) - g_list_free(dialog->protocol_opt_entries); - - if (dialog->protocol_id != NULL) - g_free(dialog->protocol_id); - if (dialog->icon_path != NULL) { const char *icon = gaim_account_get_buddy_icon(dialog->account); @@ -2572,10 +2562,7 @@ free_add_user_data(GaimGtkAccountAddUserData *data) { g_free(data->username); - - if (data->alias != NULL) - g_free(data->alias); - + g_free(data->alias); g_free(data); } @@ -2645,7 +2632,7 @@ data = g_new0(GaimGtkAccountAddUserData, 1); data->account = account; data->username = g_strdup(remote_user); - data->alias = (alias != NULL ? g_strdup(alias) : NULL); + data->alias = g_strdup(alias); buffer = make_info(account, gc, remote_user, id, alias, msg); Modified: branches/v2_0_0/src/gtkblist.c =================================================================== --- branches/v2_0_0/src/gtkblist.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkblist.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -541,9 +541,7 @@ ((GtkBoxChild *)GTK_BOX(data->entries_box)->children->data)->widget); } - if (data->entries != NULL) - g_list_free(data->entries); - + g_list_free(data->entries); data->entries = NULL; if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) @@ -1508,8 +1506,7 @@ if (aims == NULL && icqs == NULL && yahoos == NULL && msns == NULL && jabbers == NULL) { - if (alias != NULL) - g_free(alias); + g_free(alias); return FALSE; } @@ -1520,8 +1517,7 @@ add_buddies_from_vcard("prpl-msn", group, msns, alias); add_buddies_from_vcard("prpl-jabber", group, jabbers, alias); - if (alias != NULL) - g_free(alias); + g_free(alias); return TRUE; } @@ -1583,7 +1579,6 @@ GValue val; GString *str; const char *protocol; - char *mime_str; ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row"); sourcerow = gtk_tree_row_reference_get_path(ref); @@ -1643,15 +1638,13 @@ str = g_string_append(str, "\r\n"); - mime_str = g_string_free(str, FALSE); - gtk_selection_data_set(data, gdk_atom_intern("application/x-im-contact", FALSE), 8, /* bits */ - (const guchar *)mime_str, - strlen(mime_str) + 1); + (const guchar *)str->str, + strlen(str->str) + 1); - g_free(mime_str); + g_string_free(str, TRUE); gtk_tree_path_free(sourcerow); } } @@ -1867,9 +1860,9 @@ } } - if (username != NULL) g_free(username); - if (protocol != NULL) g_free(protocol); - if (alias != NULL) g_free(alias); + g_free(username); + g_free(protocol); + g_free(alias); if (path != NULL) gtk_tree_path_free(path); @@ -4772,8 +4765,7 @@ ((GtkBoxChild *)GTK_BOX(data->entries_box)->children->data)->widget); } - if (data->entries != NULL) - g_list_free(data->entries); + g_list_free(data->entries); data->entries = NULL; @@ -5805,7 +5797,7 @@ submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); gtk_widget_show(submenu); - + gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); path = g_strdup_printf("%s/Tools/%s", gtkblist->ift->path, plugin->info->name); gtk_menu_set_accel_path(GTK_MENU(submenu), path); Modified: branches/v2_0_0/src/gtkconv.c =================================================================== --- branches/v2_0_0/src/gtkconv.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkconv.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -193,15 +193,9 @@ static gint close_conv_cb(GtkWidget *w, GaimGtkConversation *gtkconv) { - GList *list = g_list_copy(gtkconv->convs), *l; + GList *list = g_list_copy(gtkconv->convs); - l = list; - while (l) { - GaimConversation *conv = l->data; - gaim_conversation_destroy(conv); - l = l->next; - } - + g_list_foreach(list, (GFunc)gaim_conversation_destroy, NULL); g_list_free(list); return TRUE; @@ -488,8 +482,7 @@ case GAIM_CMD_STATUS_FAILED: gaim_conversation_write(conv, "", error ? error : _("Your command failed for an unknown reason."), GAIM_MESSAGE_NO_LOG, time(NULL)); - if(error) - g_free(error); + g_free(error); return TRUE; case GAIM_CMD_STATUS_WRONG_TYPE: if(gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) @@ -770,8 +763,8 @@ } } - if (username != NULL) g_free(username); - if (protocol != NULL) g_free(protocol); + g_free(username); + g_free(protocol); gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); } @@ -1425,7 +1418,7 @@ gaim_conv_chat_ignore(chat, name); cbuddy = gaim_conv_chat_cb_new(name, alias, flags); - + add_chat_buddy_common(conv, cbuddy, NULL); g_free(name); g_free(alias); @@ -1524,7 +1517,7 @@ who = g_object_get_data(G_OBJECT(w), "user_data"); mark = get_mark_for_user(gtkconv, who); - + if (mark != NULL) gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(gtkconv->imhtml), mark, 0.1, FALSE, 0, 0); else @@ -3213,8 +3206,7 @@ GaimBlistNode *gnode,*cnode,*bnode; static GList *tmp = NULL; - if (tmp) - g_list_free(tmp); + g_list_free(tmp); tmp = g_list_append(NULL, ""); @@ -4260,8 +4252,8 @@ } } - if (username != NULL) g_free(username); - if (protocol != NULL) g_free(protocol); + g_free(username); + g_free(protocol); gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); } @@ -4867,8 +4859,7 @@ } } - if(alias_escaped) - g_free(alias_escaped); + g_free(alias_escaped); /* Are we in a chat where we can tell which users are buddies? */ if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) && @@ -5069,7 +5060,7 @@ g_return_if_fail(new_alias != NULL); cbuddy = gaim_conv_chat_cb_new(new_name, new_alias, flags); - + add_chat_buddy_common(conv, cbuddy, old_name); } @@ -5176,7 +5167,7 @@ flags = gaim_conv_chat_user_get_flags(chat, user); cbuddy = gaim_conv_chat_cb_new(user, alias, flags); - + add_chat_buddy_common(conv, cbuddy, NULL); g_free(alias); } Modified: branches/v2_0_0/src/gtkdebug.c =================================================================== --- branches/v2_0_0/src/gtkdebug.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkdebug.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -58,9 +58,9 @@ gboolean invert; gboolean highlight; - + guint timer; - + regex_t regex; #else GtkWidget *find; @@ -351,8 +351,8 @@ for(m = 0; m < n_matches; m++) { GtkTextIter ms, me; - - if(matches[m].rm_eo == -1) + + if(matches[m].rm_eo == -1) break; i += offset; @@ -524,7 +524,7 @@ */ if(win->paused) return; - + gtk_tree_model_get(model, iter, 0, &text, -1); if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) { @@ -840,8 +840,7 @@ g_free(new_msg); } - if (new_domain != NULL) - g_free(new_domain); + g_free(new_domain); } #ifdef _WIN32 Modified: branches/v2_0_0/src/gtkft.c =================================================================== --- branches/v2_0_0/src/gtkft.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkft.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -1097,8 +1097,7 @@ data = GAIM_GTKXFER(xfer); if (data) { - if (data->name) - g_free(data->name); + g_free(data->name); g_free(data); xfer->ui_data = NULL; } Modified: branches/v2_0_0/src/gtkimhtml.c =================================================================== --- branches/v2_0_0/src/gtkimhtml.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkimhtml.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -220,7 +220,6 @@ int length; GString *clipboard; gchar *tmp; - gchar *ret; if (html == NULL) return NULL; @@ -238,14 +237,8 @@ g_string_append(clipboard, "<!--StartFragment-->\r\n"); g_string_append(clipboard, html); g_string_append(clipboard, "\r\n<!--EndFragment-->"); - ret = clipboard->str; - g_string_free(clipboard, FALSE); -#if 0 /* Debugging for Windows clipboard */ - gaim_debug_info("imhtml clipboard", "from gaim: %s\n", ret); -#endif - - return ret; + return g_string_free(clipboard, FALSE); } static void clipboard_copy_html_win32(GtkIMHtml *imhtml) { @@ -1248,10 +1241,8 @@ g_list_free(imhtml->scalables); g_slist_free(imhtml->im_images); - if (imhtml->protocol_name) - g_free(imhtml->protocol_name); - if (imhtml->search_string) - g_free(imhtml->search_string); + g_free(imhtml->protocol_name); + g_free(imhtml->search_string); G_OBJECT_CLASS(parent_class)->finalize (object); } @@ -2231,11 +2222,9 @@ e++; } } - g_free(val); - val = ret->str; - g_string_free(ret, FALSE); - return val; + + return g_string_free(ret, FALSE); } static const char *accepted_protocols[] = { @@ -2737,8 +2726,7 @@ gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); ws[0] = '\0'; wpos = 0; /* NEW_BIT(NEW_TEXT_BIT); */ - if (bg) - g_free(bg); + g_free(bg); bg = bgcolor; gtk_imhtml_toggle_background(imhtml, bg); } @@ -2752,8 +2740,7 @@ ws[0] = '\0'; wpos = 0; gtk_imhtml_toggle_link(imhtml, href); } - if (href) - g_free(href); + g_free(href); } break; case 46: /* IMG (opt) */ @@ -3037,14 +3024,10 @@ while (fonts) { GtkIMHtmlFontDetail *font = fonts->data; fonts = g_slist_remove (fonts, font); - if (font->face) - g_free (font->face); - if (font->fore) - g_free (font->fore); - if (font->back) - g_free (font->back); - if (font->sml) - g_free (font->sml); + g_free (font->face); + g_free (font->fore); + g_free (font->back); + g_free (font->sml); g_free (font); } @@ -3082,9 +3065,8 @@ void gtk_imhtml_set_protocol_name(GtkIMHtml *imhtml, const gchar *protocol_name) { - if (imhtml->protocol_name) - g_free(imhtml->protocol_name); - imhtml->protocol_name = protocol_name ? g_strdup(protocol_name) : NULL; + g_free(imhtml->protocol_name); + imhtml->protocol_name = g_strdup(protocol_name); } void @@ -3174,7 +3156,7 @@ im_image->width = gdk_pixbuf_get_width(img); im_image->height = gdk_pixbuf_get_height(img); im_image->mark = NULL; - im_image->filename = filename ? g_strdup(filename) : NULL; + im_image->filename = g_strdup(filename); im_image->id = id; im_image->filesel = NULL; @@ -3441,8 +3423,7 @@ GtkIMHtmlImage *image = (GtkIMHtmlImage *)scale; g_object_unref(image->pixbuf); - if (image->filename) - g_free(image->filename); + g_free(image->filename); if (image->filesel) gtk_widget_destroy(image->filesel); g_free(scale); @@ -3559,8 +3540,7 @@ gtk_text_buffer_get_end_iter(imhtml->text_buffer, &end); gtk_text_buffer_remove_tag_by_name(imhtml->text_buffer, "search", &start, &end); - if (imhtml->search_string) - g_free(imhtml->search_string); + g_free(imhtml->search_string); imhtml->search_string = NULL; } @@ -3825,7 +3805,7 @@ strncmp(tag->name, "LINK ", 5) == 0 && imhtml->edit.link) { gtk_imhtml_toggle_link(imhtml, NULL); } - } + } } g_slist_free(tags); } @@ -3944,37 +3924,25 @@ char * gtk_imhtml_get_current_fontface(GtkIMHtml *imhtml) { - if (imhtml->edit.fontface) - return g_strdup(imhtml->edit.fontface); - else - return NULL; + return g_strdup(imhtml->edit.fontface); } char * gtk_imhtml_get_current_forecolor(GtkIMHtml *imhtml) { - if (imhtml->edit.forecolor) - return g_strdup(imhtml->edit.forecolor); - else - return NULL; + return g_strdup(imhtml->edit.forecolor); } char * gtk_imhtml_get_current_backcolor(GtkIMHtml *imhtml) { - if (imhtml->edit.backcolor) - return g_strdup(imhtml->edit.backcolor); - else - return NULL; + return g_strdup(imhtml->edit.backcolor); } char * gtk_imhtml_get_current_background(GtkIMHtml *imhtml) { - if (imhtml->edit.background) - return g_strdup(imhtml->edit.background); - else - return NULL; + return g_strdup(imhtml->edit.background); } gint @@ -4029,15 +3997,15 @@ return; imhtml->edit.bold = imhtml->edit.italic = imhtml->edit.underline = imhtml->edit.strike = FALSE; - if (imhtml->edit.forecolor) - g_free(imhtml->edit.forecolor); + g_free(imhtml->edit.forecolor); imhtml->edit.forecolor = NULL; - if (imhtml->edit.backcolor) - g_free(imhtml->edit.backcolor); + + g_free(imhtml->edit.backcolor); imhtml->edit.backcolor = NULL; - if (imhtml->edit.fontface) - g_free(imhtml->edit.fontface); + + g_free(imhtml->edit.fontface); imhtml->edit.fontface = NULL; + imhtml->edit.fontsize = 0; imhtml->edit.link = NULL; Modified: branches/v2_0_0/src/gtkimhtmltoolbar.c =================================================================== --- branches/v2_0_0/src/gtkimhtmltoolbar.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkimhtmltoolbar.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -878,8 +878,7 @@ toolbar); } - if (toolbar->sml) - free(toolbar->sml); + free(toolbar->sml); gtk_object_sink(GTK_OBJECT(toolbar->tooltips)); G_OBJECT_CLASS(parent_class)->finalize (object); @@ -1132,8 +1131,6 @@ void gtk_imhtmltoolbar_associate_smileys(GtkIMHtmlToolbar *toolbar, const char *proto_id) { - if (toolbar->sml) - g_free(toolbar->sml); - + g_free(toolbar->sml); toolbar->sml = g_strdup(proto_id); } Modified: branches/v2_0_0/src/gtklog.c =================================================================== --- branches/v2_0_0/src/gtklog.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtklog.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -111,8 +111,7 @@ const char *search_term = gtk_entry_get_text(GTK_ENTRY(lv->entry)); GList *logs; - if (lv->search != NULL) - g_free(lv->search); + g_free(lv->search); gtk_tree_store_clear(lv->treestore); if (!(*search_term)) { @@ -154,9 +153,7 @@ lv = g_hash_table_lookup(log_viewers, ht); g_hash_table_remove(log_viewers, ht); - if (ht->screenname != NULL) - g_free(ht->screenname); - + g_free(ht->screenname); g_free(ht); } else syslog_viewer = NULL; @@ -164,10 +161,9 @@ g_list_foreach(lv->logs, (GFunc)gaim_log_free, NULL); g_list_free(lv->logs); - if (lv->search != NULL) - g_free(lv->search); - + g_free(lv->search); g_free(lv); + gtk_widget_destroy(w); return TRUE; Modified: branches/v2_0_0/src/gtkpluginpref.c =================================================================== --- branches/v2_0_0/src/gtkpluginpref.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkpluginpref.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -57,9 +57,6 @@ g_return_if_fail(pref); text = gtk_imhtml_get_markup(imhtml); - - if (!text) - text = ""; gaim_prefs_set_string(pref, text); g_free(text); } Modified: branches/v2_0_0/src/gtkpounce.c =================================================================== --- branches/v2_0_0/src/gtkpounce.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkpounce.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -432,8 +432,8 @@ } } - if (username != NULL) g_free(username); - if (protocol != NULL) g_free(protocol); + g_free(username); + g_free(protocol); gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); } @@ -1195,7 +1195,7 @@ /* Create the scrolled window */ sw = gtk_scrolled_window_new(0, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), - GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); Modified: branches/v2_0_0/src/gtkprefs.c =================================================================== --- branches/v2_0_0/src/gtkprefs.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkprefs.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -1474,7 +1474,7 @@ static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val) { if(val < 15) { - return g_strdup_printf(_("Quietest")); + return g_strdup_printf(_("Quietest")); } else if(val < 30) { return g_strdup_printf(_("Quieter")); } else if(val < 45) { Modified: branches/v2_0_0/src/gtkprivacy.c =================================================================== --- branches/v2_0_0/src/gtkprivacy.c 2006-08-05 09:19:14 UTC (rev 16644) +++ branches/v2_0_0/src/gtkprivacy.c 2006-08-05 09:54:33 UTC (rev 16645) @@ -7,7 +7,7 @@ * Gaim is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * source distribution. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either ve... [truncated message content] |
From: <the...@us...> - 2006-08-05 17:44:59
|
Revision: 16651 Author: thekingant Date: 2006-08-05 10:44:56 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16651&view=rev Log Message: ----------- Backport SVN revision #16650 from HEAD to v2_0_0 Original commit message: Remove "Napster" from a few more places ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16650&view=rev Modified Paths: -------------- branches/v2_0_0/Makefile.mingw branches/v2_0_0/doc/gaim.1.in branches/v2_0_0/gaim.spec.in branches/v2_0_0/src/gtkdialogs.c Modified: branches/v2_0_0/Makefile.mingw =================================================================== --- branches/v2_0_0/Makefile.mingw 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/Makefile.mingw 2006-08-05 17:44:56 UTC (rev 16651) @@ -54,7 +54,6 @@ TOC_TYPE = PLUGIN IRC_TYPE = PLUGIN JABBER_TYPE = PLUGIN -NAPSTER_TYPE = PLUGIN GG_TYPE = PLUGIN NOVELL_TYPE = PLUGIN SILC_TYPE = PLUGIN @@ -68,7 +67,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw @@ -90,7 +88,6 @@ $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw install $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw install $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw install - $(MAKE) TYPE='$(NAPSTER_TYPE)' -C $(NAPSTER) -f Makefile.mingw install $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw install $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw install $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw install @@ -118,7 +115,6 @@ $(MAKE) -C $(MSN) -f Makefile.mingw clean $(MAKE) -C $(IRC) -f Makefile.mingw clean $(MAKE) -C $(JABBER) -f Makefile.mingw clean - $(MAKE) -C $(NAPSTER) -f Makefile.mingw clean $(MAKE) -C $(GG) -f Makefile.mingw clean $(MAKE) -C $(NOVELL) -f Makefile.mingw clean $(MAKE) -C $(SILC) -f Makefile.mingw clean Modified: branches/v2_0_0/doc/gaim.1.in =================================================================== --- branches/v2_0_0/doc/gaim.1.in 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/doc/gaim.1.in 2006-08-05 17:44:56 UTC (rev 16651) @@ -30,7 +30,7 @@ .PP \fBgaim\fR is a GTK2-based Instant Messaging (IM) application. It supports multiple protocols via modules, including AIM, ICQ, Yahoo!, MSN, Jabber, -IRC, Napster, Gadu-Gadu and Zephyr. It has many common features found in +IRC, Gadu-Gadu and Zephyr. It has many common features found in other clients, as well as many unique features. Gaim is not endorsed by or affiliated with America Online, ICQ, Microsoft, or Yahoo. Modified: branches/v2_0_0/gaim.spec.in =================================================================== --- branches/v2_0_0/gaim.spec.in 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/gaim.spec.in 2006-08-05 17:44:56 UTC (rev 16651) @@ -112,7 +112,7 @@ %description Gaim allows you to talk to anyone using a variety of messaging protocols, including AIM, ICQ, IRC, Yahoo!, Novell Groupwise, MSN -Messenger, Jabber, Gadu-Gadu, Napster, Lotus Sametime and Zephyr. +Messenger, Jabber, Gadu-Gadu, Lotus Sametime and Zephyr. These protocols are implemented using a modular, easy to use design. To use a protocol, just add an account using the account editor. Modified: branches/v2_0_0/src/gtkdialogs.c =================================================================== --- branches/v2_0_0/src/gtkdialogs.c 2006-08-05 17:40:38 UTC (rev 16650) +++ branches/v2_0_0/src/gtkdialogs.c 2006-08-05 17:44:56 UTC (rev 16651) @@ -268,7 +268,7 @@ g_string_append(str, _("Gaim is a modular messaging client capable of using " "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, " - "Novell GroupWise, Lotus Sametime, Napster, Zephyr, and Gadu-Gadu " + "Novell GroupWise, Lotus Sametime, Zephyr, and Gadu-Gadu " "all at once. It is written using GTK+.<BR><BR>" "You may modify and redistribute the program under " "the terms of the GPL (version 2 or later). A copy of the GPL is " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lsc...@us...> - 2006-08-09 15:34:16
|
Revision: 16680 Author: lschiere Date: 2006-08-09 08:33:53 -0700 (Wed, 09 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16680&view=rev Log Message: ----------- With much help from datallah, I present to you the translation updates earlier committed to trunk, with the same caveat about the confusion in gu.po Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/po/ChangeLog branches/v2_0_0/po/de.po branches/v2_0_0/po/fi.po branches/v2_0_0/po/gl.po branches/v2_0_0/po/gu.po branches/v2_0_0/po/it.po branches/v2_0_0/po/sl.po branches/v2_0_0/po/zh_TW.po branches/v2_0_0/src/gtkdialogs.c Added Paths: ----------- branches/v2_0_0/po/ne.po Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-08-09 14:47:37 UTC (rev 16679) +++ branches/v2_0_0/configure.ac 2006-08-09 15:33:53 UTC (rev 16680) @@ -46,7 +46,7 @@ ;; esac -ALL_LINGUAS="am az bg bn bs ca ca@valencia cs da de el en_AU en_CA en_GB es et eu fa fi fr gl gu he hi hu it ja ka ko ku lt mk my_MM nb nl nn pa pl pt_BR pt ro ru sk sl sq sr sr@Latn sv ta te th tr uk vi xh zh_CN zh_TW" +ALL_LINGUAS="am az bg bn bs ca ca@valencia cs da de el en_AU en_CA en_GB es et eu fa fi fr gl gu he hi hu it ja ka ko ku lt mk my_MM nb ne nl nn pa pl pt_BR pt ro ru sk sl sq sr sr@Latn sv ta te th tr uk vi xh zh_CN zh_TW" AM_GLIB_GNU_GETTEXT dnl we don't use autobreak on cygwin!! Modified: branches/v2_0_0/po/ChangeLog =================================================================== --- branches/v2_0_0/po/ChangeLog 2006-08-09 14:47:37 UTC (rev 16679) +++ branches/v2_0_0/po/ChangeLog 2006-08-09 15:33:53 UTC (rev 16680) @@ -23,13 +23,16 @@ * German translation updated (Bjoern Voigt) * German win32 translation updated (Bjoern Voigt) * Greek translation added (Bouklis Panos) + * Gujarati translation updated (Ankit Patel) * Hebrew translation updated (Shalom Craimer) * Hungarian translation updated (Gabor Kelemen) + * Italian translation updated (Claudio Satriano) * Japanese translation updated (Takeshi Aihana) * Kurdish translation added (Erdal Ronahi and Amed Ç. Jiyan) * Kurdish win32 installer translation added (Erdal Ronahi) * Lithuanian translation updated (Andrius Štikonas, Laurynas Biveinis) * Lithuanian win32 translation added (Laurynas Biveinis) + * Nepali translation added (Shyam Krishna Bal) * Persian translation added (Elnaz Sarbar, Meelad Zakaria) * Polish translation updated (Emil Nowak) * Portuguese translation updated (Duarte Henriques) Modified: branches/v2_0_0/po/de.po =================================================================== --- branches/v2_0_0/po/de.po 2006-08-09 14:47:37 UTC (rev 16679) +++ branches/v2_0_0/po/de.po 2006-08-09 15:33:53 UTC (rev 16680) @@ -10,8 +10,8 @@ msgstr "" "Project-Id-Version: Gaim\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-04-29 23:34+0200\n" -"PO-Revision-Date: 2006-04-29 23:33+0200\n" +"POT-Creation-Date: 2006-06-20 10:30+0200\n" +"PO-Revision-Date: 2006-06-20 10:38+0200\n" "Last-Translator: Björn Voigt <bj...@cs...>\n" "Language-Team: de <de...@li...>\n" "MIME-Version: 1.0\n" @@ -196,7 +196,7 @@ msgid "Right-click for more unread messages...\n" msgstr "Rechtsklicken für weitere ungelesene Nachrichten...\n" -#: ../plugins/docklet/docklet.c:157 ../src/gtkblist.c:3230 +#: ../plugins/docklet/docklet.c:157 ../src/gtkblist.c:3246 #, c-format msgid "%d unread message from %s\n" msgid_plural "%d unread messages from %s\n" @@ -208,10 +208,10 @@ msgstr "Ändere Status" #: ../plugins/docklet/docklet.c:435 ../src/gtkstatusbox.c:673 -#: ../src/protocols/gg/gg.c:996 ../src/protocols/jabber/buddy.c:1104 +#: ../src/protocols/gg/gg.c:996 ../src/protocols/jabber/buddy.c:1363 #: ../src/protocols/msn/state.c:29 ../src/protocols/msn/state.c:30 #: ../src/protocols/msn/state.c:37 ../src/protocols/msn/state.c:38 -#: ../src/protocols/novell/novell.c:2845 ../src/protocols/yahoo/yahoo.c:2733 +#: ../src/protocols/novell/novell.c:2843 ../src/protocols/yahoo/yahoo.c:2731 #: ../src/status.c:155 msgid "Available" msgstr "Verfügbar" @@ -222,25 +222,25 @@ #: ../plugins/docklet/docklet.c:439 ../src/gtkprefs.c:1774 #: ../src/gtkstatusbox.c:674 ../src/protocols/gg/gg.c:999 #: ../src/protocols/irc/irc.c:520 ../src/protocols/irc/msgs.c:223 -#: ../src/protocols/jabber/buddy.c:1108 ../src/protocols/novell/novell.c:2848 -#: ../src/protocols/oscar/oscar.c:719 ../src/protocols/oscar/oscar.c:4391 -#: ../src/protocols/oscar/oscar.c:5434 ../src/protocols/silc/buddy.c:1469 -#: ../src/protocols/yahoo/yahoo.c:3187 ../src/protocols/yahoo/yahoo.c:3260 +#: ../src/protocols/jabber/buddy.c:1367 ../src/protocols/novell/novell.c:2846 +#: ../src/protocols/oscar/oscar.c:719 ../src/protocols/oscar/oscar.c:4397 +#: ../src/protocols/oscar/oscar.c:5440 ../src/protocols/silc/buddy.c:1469 +#: ../src/protocols/yahoo/yahoo.c:3185 ../src/protocols/yahoo/yahoo.c:3258 #: ../src/status.c:158 msgid "Away" msgstr "Abwesend" #: ../plugins/docklet/docklet.c:443 ../src/gtkstatusbox.c:675 -#: ../src/protocols/oscar/oscar.c:723 ../src/protocols/yahoo/yahoo.c:2727 +#: ../src/protocols/oscar/oscar.c:723 ../src/protocols/yahoo/yahoo.c:2725 #: ../src/status.c:157 msgid "Invisible" msgstr "Unsichtbar" -#: ../plugins/docklet/docklet.c:447 ../src/gtkblist.c:2960 +#: ../plugins/docklet/docklet.c:447 ../src/gtkblist.c:2976 #: ../src/gtkstatusbox.c:676 ../src/protocols/gg/gg.c:993 -#: ../src/protocols/jabber/buddy.c:1102 ../src/protocols/novell/novell.c:2857 -#: ../src/protocols/oscar/oscar.c:785 ../src/protocols/oscar/oscar.c:5406 -#: ../src/protocols/yahoo/yahoo.c:2731 ../src/status.c:154 +#: ../src/protocols/jabber/buddy.c:1361 ../src/protocols/novell/novell.c:2855 +#: ../src/protocols/oscar/oscar.c:785 ../src/protocols/oscar/oscar.c:5412 +#: ../src/protocols/yahoo/yahoo.c:2729 ../src/status.c:154 msgid "Offline" msgstr "Offline" @@ -256,7 +256,7 @@ msgid "Show Buddy List" msgstr "Buddy-Liste anzeigen" -#: ../plugins/docklet/docklet.c:489 ../src/gtkconv.c:5626 +#: ../plugins/docklet/docklet.c:489 ../src/gtkconv.c:5675 msgid "Unread Messages" msgstr "Ungelesene Nachrichten" @@ -296,7 +296,7 @@ msgstr "_Sofortnachrichten:" #: ../plugins/docklet/docklet.c:684 ../plugins/docklet/docklet.c:692 -#: ../plugins/win32/winprefs/winprefs.c:424 ../src/gtkprefs.c:823 +#: ../plugins/win32/winprefs/winprefs.c:462 ../src/gtkprefs.c:823 #: ../src/gtkprefs.c:1764 ../src/gtkprefs.c:1778 msgid "Never" msgstr "Niemals" @@ -307,7 +307,7 @@ #: ../plugins/docklet/docklet.c:686 ../plugins/docklet/docklet.c:694 #: ../plugins/timestamp_format.c:39 ../plugins/timestamp_format.c:48 -#: ../plugins/win32/winprefs/winprefs.c:425 ../src/gtkprefs.c:825 +#: ../plugins/win32/winprefs/winprefs.c:463 ../src/gtkprefs.c:825 msgid "Always" msgstr "Immer" @@ -617,7 +617,7 @@ #. Business #: ../plugins/gevolution/add_buddy_dialog.c:131 #: ../plugins/gevolution/assoc-buddy.c:119 ../src/gtkplugin.c:587 -#: ../src/gtkroomlist.c:604 ../src/protocols/jabber/jabber.c:755 +#: ../src/gtkroomlist.c:604 ../src/protocols/jabber/jabber.c:759 #: ../src/protocols/msn/msn.c:1532 ../src/protocols/msn/msn.c:1585 #: ../src/protocols/msn/msn.c:1606 msgid "Name" @@ -627,10 +627,10 @@ msgid "Instant Messaging" msgstr "Sofortnachrichten" -#: ../plugins/gevolution/add_buddy_dialog.c:442 ../src/gtkblist.c:4526 +#: ../plugins/gevolution/add_buddy_dialog.c:442 ../src/gtkblist.c:4532 #: ../src/protocols/silc/buddy.c:736 ../src/protocols/silc/buddy.c:1030 #: ../src/protocols/silc/buddy.c:1075 ../src/protocols/silc/buddy.c:1174 -#: ../src/protocols/yahoo/yahoo.c:2976 +#: ../src/protocols/yahoo/yahoo.c:2974 msgid "Add Buddy" msgstr "Buddy hinzufügen" @@ -644,14 +644,14 @@ #. "Search" #: ../plugins/gevolution/add_buddy_dialog.c:468 #: ../plugins/gevolution/assoc-buddy.c:353 -#: ../src/protocols/jabber/buddy.c:1460 ../src/protocols/oscar/oscar.c:6014 -#: ../src/protocols/sametime/sametime.c:5531 +#: ../src/protocols/jabber/buddy.c:1720 ../src/protocols/oscar/oscar.c:6020 +#: ../src/protocols/sametime/sametime.c:5529 msgid "Search" msgstr "Suchen" #: ../plugins/gevolution/add_buddy_dialog.c:549 -#: ../plugins/gevolution/new_person_dialog.c:307 ../src/gtkblist.c:4610 -#: ../src/gtkblist.c:4974 +#: ../plugins/gevolution/new_person_dialog.c:307 ../src/gtkblist.c:4616 +#: ../src/gtkblist.c:4980 msgid "Group:" msgstr "Gruppe:" @@ -687,13 +687,13 @@ msgstr "_Assoziiere den Buddy" #: ../plugins/gevolution/eds-utils.c:73 ../plugins/gevolution/eds-utils.c:86 -#: ../src/protocols/jabber/jabber.c:1122 +#: ../src/protocols/jabber/jabber.c:1125 msgid "None" msgstr "Kein" #: ../plugins/gevolution/gevo-util.c:64 ../plugins/gevolution/gevolution.c:96 #: ../src/blist.c:516 ../src/blist.c:1278 ../src/blist.c:1505 -#: ../src/gtkblist.c:4419 ../src/protocols/jabber/roster.c:65 +#: ../src/gtkblist.c:4425 ../src/protocols/jabber/roster.c:66 msgid "Buddies" msgstr "Buddys" @@ -730,8 +730,8 @@ "Wählen Sie alle Konten, zu denen Buddys automatisch hinzugefügt werden " "sollen." -#: ../plugins/gevolution/gevolution.c:450 ../plugins/idle.c:150 -#: ../plugins/idle.c:186 ../src/gtknotify.c:399 ../src/gtkpounce.c:1262 +#: ../plugins/gevolution/gevolution.c:450 ../plugins/idle.c:153 +#: ../plugins/idle.c:189 ../src/gtknotify.c:399 ../src/gtkpounce.c:1255 msgid "Account" msgstr "Konto" @@ -768,7 +768,7 @@ msgstr "Kontotyp:" #: ../plugins/gevolution/new_person_dialog.c:295 ../src/gtkaccount.c:784 -#: ../src/gtkblist.c:4572 +#: ../src/gtkblist.c:4578 msgid "Screen name:" msgstr "Benutzername:" @@ -870,50 +870,50 @@ msgid "Iconifies the buddy list and your conversations when you go away." msgstr "Minimiert die Buddy-Liste und die Gesprächsfenster, wenn Sie weggehen." -#: ../plugins/idle.c:155 ../plugins/idle.c:213 +#: ../plugins/idle.c:158 ../plugins/idle.c:216 msgid "Minutes" msgstr "Minuten" #. This is a cultural reference. Dy'er Mak'er is a song by Led Zeppelin. #. If that doesn't translate well into your language, drop the 's before translating. -#: ../plugins/idle.c:162 ../plugins/idle.c:195 ../plugins/idle.c:220 -#: ../plugins/idle.c:312 +#: ../plugins/idle.c:165 ../plugins/idle.c:198 ../plugins/idle.c:223 +#: ../plugins/idle.c:315 msgid "I'dle Mak'er" msgstr "Untätigkeitsmarker" -#: ../plugins/idle.c:163 ../plugins/idle.c:252 +#: ../plugins/idle.c:166 ../plugins/idle.c:255 msgid "Set Account Idle Time" msgstr "Setze Konto-Untätigkeitszeit" -#: ../plugins/idle.c:166 ../plugins/idle.c:224 +#: ../plugins/idle.c:169 ../plugins/idle.c:227 msgid "_Set" msgstr "_Setzen" -#: ../plugins/idle.c:167 ../plugins/idle.c:200 ../plugins/idle.c:225 +#: ../plugins/idle.c:170 ../plugins/idle.c:203 ../plugins/idle.c:228 msgid "_Cancel" msgstr "A_bbrechen" -#: ../plugins/idle.c:180 +#: ../plugins/idle.c:183 msgid "None of your accounts are idle." msgstr "Keine ihrer Konten sind untätig." -#: ../plugins/idle.c:196 ../plugins/idle.c:256 +#: ../plugins/idle.c:199 ../plugins/idle.c:259 msgid "Unset Account Idle Time" msgstr "Untätigkeitszeit zurücksetzen" -#: ../plugins/idle.c:199 +#: ../plugins/idle.c:202 msgid "_Unset" msgstr "Zurücksetze_n" -#: ../plugins/idle.c:221 ../plugins/idle.c:260 +#: ../plugins/idle.c:224 ../plugins/idle.c:263 msgid "Set Idle Time for All Accounts" msgstr "Untätigkeitszeit für alle Konten setzen" -#: ../plugins/idle.c:265 +#: ../plugins/idle.c:268 msgid "Unset Idle Time for All Idled Accounts" msgstr "Untätigkeitszeit für alle untätige Konten zurücksetzen" -#: ../plugins/idle.c:314 ../plugins/idle.c:315 +#: ../plugins/idle.c:317 ../plugins/idle.c:318 msgid "Allows you to hand-configure how long you've been idle" msgstr "" "Erlaubt Ihnen manuell zu konfigurieren, wie lange Sie untätig sein wollen" @@ -1661,7 +1661,7 @@ #. *< dependencies #. *< priority #. *< id -#: ../plugins/timestamp.c:254 +#: ../plugins/timestamp.c:256 msgid "Timestamp" msgstr "Zeitstempel" @@ -1669,7 +1669,7 @@ #. *< version #. * summary #. * description -#: ../plugins/timestamp.c:257 ../plugins/timestamp.c:259 +#: ../plugins/timestamp.c:259 ../plugins/timestamp.c:261 msgid "Adds iChat-style timestamps to conversations every N minutes." msgstr "Fügt iChat-ähnliche Zeitstempel alle N Minuten in die Gespräche ein." @@ -1798,57 +1798,57 @@ "\n" "* Hinweis: Dieses Plugin verlangt Win2000 oder höher." -#: ../plugins/win32/winprefs/winprefs.c:397 +#: ../plugins/win32/winprefs/winprefs.c:434 msgid "GTK+ Runtime Version" msgstr "GTK+ Runtime Version" #. Autostart -#: ../plugins/win32/winprefs/winprefs.c:405 +#: ../plugins/win32/winprefs/winprefs.c:442 msgid "Startup" msgstr "Start" -#: ../plugins/win32/winprefs/winprefs.c:406 +#: ../plugins/win32/winprefs/winprefs.c:443 msgid "_Start Gaim on Windows startup" msgstr "_Starte Gaim beim Windows-Start" #. Buddy List -#: ../plugins/win32/winprefs/winprefs.c:417 ../src/gtkblist.c:3663 +#: ../plugins/win32/winprefs/winprefs.c:455 ../src/gtkblist.c:3672 msgid "Buddy List" msgstr "Buddy-Liste" -#: ../plugins/win32/winprefs/winprefs.c:418 +#: ../plugins/win32/winprefs/winprefs.c:456 msgid "_Dockable Buddy List" msgstr "An_dockbare Buddy-Liste" #. Blist On Top -#: ../plugins/win32/winprefs/winprefs.c:422 +#: ../plugins/win32/winprefs/winprefs.c:460 msgid "_Keep Buddy List window on top:" msgstr "_Buddy-Listen-Fenster bleibt im Vordergrund:" #. XXX: Did this ever work? -#: ../plugins/win32/winprefs/winprefs.c:427 +#: ../plugins/win32/winprefs/winprefs.c:465 msgid "Only when docked" msgstr "Nur wenn angedockt" #. Conversations -#: ../plugins/win32/winprefs/winprefs.c:431 ../src/gtkprefs.c:819 +#: ../plugins/win32/winprefs/winprefs.c:469 ../src/gtkprefs.c:819 #: ../src/gtkprefs.c:1879 msgid "Conversations" msgstr "Unterhaltungen" -#: ../plugins/win32/winprefs/winprefs.c:432 +#: ../plugins/win32/winprefs/winprefs.c:470 msgid "_Flash window when messages are received" msgstr "_Fenster blinkt, wenn Nachrichten empfangen werden" -#: ../plugins/win32/winprefs/winprefs.c:456 +#: ../plugins/win32/winprefs/winprefs.c:494 msgid "WinGaim Options" msgstr "WinGaim Optionen" -#: ../plugins/win32/winprefs/winprefs.c:458 +#: ../plugins/win32/winprefs/winprefs.c:496 msgid "Options specific to Windows Gaim." msgstr "Windows-Gaim-spezifische Optionen." -#: ../plugins/win32/winprefs/winprefs.c:459 +#: ../plugins/win32/winprefs/winprefs.c:497 msgid "" "Provides options specific to Windows Gaim, such as buddy list docking and " "conversation flashing." @@ -1860,139 +1860,138 @@ msgid "accounts" msgstr "Konten" -#: ../src/account.c:923 +#: ../src/account.c:918 msgid "Password is required to sign on." msgstr "Passwort wird für die Anmeldung benötigt." -#: ../src/account.c:948 +#: ../src/account.c:943 #, c-format msgid "Enter password for %s (%s)" msgstr "Geben Sie das Passwort für %s (%s) ein" -#: ../src/account.c:955 +#: ../src/account.c:950 msgid "Enter Password" msgstr "Geben Sie ein Passwort ein" -#: ../src/account.c:960 +#: ../src/account.c:955 msgid "Save password" msgstr "Passwort speichern" #. * #. * A wrapper for gaim_request_action() that uses @c OK and @c Cancel buttons. #. -#: ../src/account.c:968 ../src/account.c:1139 ../src/gtkblist.c:3546 -#: ../src/gtkdialogs.c:602 ../src/gtkdialogs.c:739 ../src/gtkdialogs.c:803 +#: ../src/account.c:963 ../src/account.c:1134 ../src/gtkblist.c:3556 +#: ../src/gtkdialogs.c:613 ../src/gtkdialogs.c:750 ../src/gtkdialogs.c:824 #: ../src/gtkrequest.c:269 ../src/protocols/gg/gg.c:497 #: ../src/protocols/gg/gg.c:655 ../src/protocols/gg/gg.c:791 -#: ../src/protocols/jabber/jabber.c:1319 ../src/protocols/jabber/xdata.c:337 +#: ../src/protocols/jabber/jabber.c:1322 ../src/protocols/jabber/xdata.c:337 #: ../src/protocols/msn/msn.c:250 ../src/protocols/msn/msn.c:265 #: ../src/protocols/msn/msn.c:280 ../src/protocols/msn/msn.c:295 #: ../src/protocols/oscar/oscar.c:1408 ../src/protocols/oscar/oscar.c:2167 -#: ../src/protocols/oscar/oscar.c:2260 ../src/protocols/oscar/oscar.c:5684 -#: ../src/protocols/oscar/oscar.c:5864 ../src/protocols/oscar/oscar.c:5889 -#: ../src/protocols/oscar/oscar.c:5945 ../src/protocols/silc/buddy.c:466 +#: ../src/protocols/oscar/oscar.c:2260 ../src/protocols/oscar/oscar.c:5690 +#: ../src/protocols/oscar/oscar.c:5870 ../src/protocols/oscar/oscar.c:5895 +#: ../src/protocols/oscar/oscar.c:5951 ../src/protocols/silc/buddy.c:466 #: ../src/protocols/silc/buddy.c:1182 ../src/protocols/silc/chat.c:424 #: ../src/protocols/silc/chat.c:462 ../src/protocols/silc/chat.c:725 #: ../src/protocols/silc/ops.c:1297 ../src/protocols/silc/ops.c:1910 -#: ../src/protocols/silc/silc.c:753 ../src/protocols/yahoo/yahoo.c:3061 -#: ../src/protocols/yahoo/yahoo.c:3070 ../src/request.h:1344 +#: ../src/protocols/silc/silc.c:753 ../src/protocols/yahoo/yahoo.c:3059 +#: ../src/protocols/yahoo/yahoo.c:3068 ../src/request.h:1344 msgid "OK" msgstr "OK" -#: ../src/account.c:969 ../src/account.c:1140 ../src/account.c:1177 -#: ../src/gtkaccount.c:2182 ../src/gtkaccount.c:2649 ../src/gtkblist.c:5015 -#: ../src/gtkdialogs.c:603 ../src/gtkdialogs.c:740 ../src/gtkdialogs.c:804 -#: ../src/gtkdialogs.c:823 ../src/gtkdialogs.c:845 ../src/gtkdialogs.c:865 -#: ../src/gtkdialogs.c:909 ../src/gtkdialogs.c:964 ../src/gtkdialogs.c:1001 -#: ../src/gtkdialogs.c:1026 ../src/gtkimhtmltoolbar.c:419 -#: ../src/gtkplugin.c:296 ../src/gtkpounce.c:1095 ../src/gtkprivacy.c:568 +#: ../src/account.c:964 ../src/account.c:1135 ../src/account.c:1172 +#: ../src/gtkaccount.c:2182 ../src/gtkaccount.c:2649 ../src/gtkblist.c:5021 +#: ../src/gtkdialogs.c:614 ../src/gtkdialogs.c:751 ../src/gtkdialogs.c:825 +#: ../src/gtkdialogs.c:844 ../src/gtkdialogs.c:866 ../src/gtkdialogs.c:886 +#: ../src/gtkdialogs.c:930 ../src/gtkdialogs.c:985 ../src/gtkdialogs.c:1022 +#: ../src/gtkdialogs.c:1047 ../src/gtkimhtmltoolbar.c:419 +#: ../src/gtkplugin.c:296 ../src/gtkpounce.c:1088 ../src/gtkprivacy.c:568 #: ../src/gtkprivacy.c:581 ../src/gtkprivacy.c:606 ../src/gtkprivacy.c:617 #: ../src/gtkrequest.c:270 ../src/gtksavedstatuses.c:296 #: ../src/protocols/gg/gg.c:498 ../src/protocols/gg/gg.c:656 #: ../src/protocols/gg/gg.c:792 ../src/protocols/gg/gg.c:871 -#: ../src/protocols/jabber/buddy.c:576 ../src/protocols/jabber/buddy.c:1461 -#: ../src/protocols/jabber/buddy.c:1495 ../src/protocols/jabber/chat.c:780 -#: ../src/protocols/jabber/jabber.c:824 ../src/protocols/jabber/jabber.c:1320 +#: ../src/protocols/jabber/buddy.c:594 ../src/protocols/jabber/buddy.c:1721 +#: ../src/protocols/jabber/buddy.c:1755 ../src/protocols/jabber/chat.c:778 +#: ../src/protocols/jabber/jabber.c:828 ../src/protocols/jabber/jabber.c:1323 #: ../src/protocols/jabber/xdata.c:338 ../src/protocols/msn/msn.c:251 #: ../src/protocols/msn/msn.c:266 ../src/protocols/msn/msn.c:281 #: ../src/protocols/msn/msn.c:296 ../src/protocols/msn/msn.c:313 #: ../src/protocols/oscar/oscar.c:1409 ../src/protocols/oscar/oscar.c:2168 #: ../src/protocols/oscar/oscar.c:2209 ../src/protocols/oscar/oscar.c:2261 -#: ../src/protocols/oscar/oscar.c:5685 ../src/protocols/oscar/oscar.c:5737 -#: ../src/protocols/oscar/oscar.c:5865 ../src/protocols/oscar/oscar.c:5890 -#: ../src/protocols/oscar/oscar.c:5946 ../src/protocols/oscar/oscar.c:6015 -#: ../src/protocols/oscar/peer.c:942 ../src/protocols/sametime/sametime.c:3375 -#: ../src/protocols/sametime/sametime.c:3460 -#: ../src/protocols/sametime/sametime.c:3630 -#: ../src/protocols/sametime/sametime.c:5319 -#: ../src/protocols/sametime/sametime.c:5408 -#: ../src/protocols/sametime/sametime.c:5532 ../src/protocols/silc/buddy.c:467 +#: ../src/protocols/oscar/oscar.c:5691 ../src/protocols/oscar/oscar.c:5743 +#: ../src/protocols/oscar/oscar.c:5871 ../src/protocols/oscar/oscar.c:5896 +#: ../src/protocols/oscar/oscar.c:5952 ../src/protocols/oscar/oscar.c:6021 +#: ../src/protocols/oscar/peer.c:942 ../src/protocols/sametime/sametime.c:3368 +#: ../src/protocols/sametime/sametime.c:3453 +#: ../src/protocols/sametime/sametime.c:3623 +#: ../src/protocols/sametime/sametime.c:5317 +#: ../src/protocols/sametime/sametime.c:5406 +#: ../src/protocols/sametime/sametime.c:5530 ../src/protocols/silc/buddy.c:467 #: ../src/protocols/silc/buddy.c:1078 ../src/protocols/silc/buddy.c:1183 #: ../src/protocols/silc/chat.c:597 ../src/protocols/silc/chat.c:726 #: ../src/protocols/silc/ops.c:1911 ../src/protocols/silc/silc.c:754 -#: ../src/protocols/silc/silc.c:959 ../src/protocols/yahoo/yahoo.c:3062 -#: ../src/protocols/yahoo/yahoo.c:3071 ../src/request.h:1344 +#: ../src/protocols/silc/silc.c:959 ../src/protocols/yahoo/yahoo.c:3060 +#: ../src/protocols/yahoo/yahoo.c:3069 ../src/request.h:1344 #: ../src/request.h:1354 msgid "Cancel" msgstr "Abbrechen" -#: ../src/account.c:994 ../src/connection.c:96 +#: ../src/account.c:989 ../src/connection.c:96 #, c-format msgid "Missing protocol plugin for %s" msgstr "Fehlendes Protokoll-Plugin für %s" -#: ../src/account.c:996 ../src/connection.c:99 ../src/gtkblist.c:3538 -#: ../src/gtkblist.c:3544 +#: ../src/account.c:991 ../src/connection.c:99 ../src/gtkblist.c:3554 msgid "Connection Error" msgstr "Verbindungsfehler" -#: ../src/account.c:1076 ../src/protocols/gg/gg.c:696 -#: ../src/protocols/jabber/jabber.c:1272 +#: ../src/account.c:1071 ../src/protocols/gg/gg.c:696 +#: ../src/protocols/jabber/jabber.c:1275 msgid "New passwords do not match." msgstr "Die neuen Passwörter stimmen nicht überein." -#: ../src/account.c:1085 +#: ../src/account.c:1080 msgid "Fill out all fields completely." msgstr "Bitte füllen Sie alle Felder aus." -#: ../src/account.c:1108 +#: ../src/account.c:1103 msgid "Original password" msgstr "Aktuelles Passwort" -#: ../src/account.c:1115 +#: ../src/account.c:1110 msgid "New password" msgstr "Neues Passwort" -#: ../src/account.c:1122 +#: ../src/account.c:1117 msgid "New password (again)" msgstr "Neues Passwort (nochmal)" -#: ../src/account.c:1128 +#: ../src/account.c:1123 #, c-format msgid "Change password for %s" msgstr "Ändern des Passworts für %s" -#: ../src/account.c:1136 +#: ../src/account.c:1131 msgid "Please enter your current password and your new password." msgstr "Bitte geben Sie Ihr aktuelles und Ihr neues Passwort ein." -#: ../src/account.c:1169 +#: ../src/account.c:1164 #, c-format msgid "Change user information for %s" msgstr "Ändere die Benutzerinformation für %s" -#: ../src/account.c:1172 ../src/protocols/toc/toc.c:1684 +#: ../src/account.c:1167 ../src/protocols/toc/toc.c:1684 msgid "Set User Info" msgstr "Benutzer-Info setzen" -#: ../src/account.c:1176 ../src/gtkdebug.c:684 ../src/gtkrequest.c:276 -#: ../src/protocols/jabber/buddy.c:575 +#: ../src/account.c:1171 ../src/gtkdebug.c:684 ../src/gtkrequest.c:276 +#: ../src/protocols/jabber/buddy.c:593 msgid "Save" msgstr "Speichern" -#: ../src/account.c:1679 ../src/gtkft.c:159 ../src/protocols/gg/gg.c:1002 -#: ../src/protocols/jabber/buddy.c:633 ../src/protocols/jabber/buddy.c:1098 -#: ../src/protocols/jabber/buddy.c:1115 ../src/protocols/novell/novell.c:2860 +#: ../src/account.c:1681 ../src/gtkft.c:159 ../src/protocols/gg/gg.c:1002 +#: ../src/protocols/jabber/buddy.c:636 ../src/protocols/jabber/buddy.c:1357 +#: ../src/protocols/jabber/buddy.c:1374 ../src/protocols/novell/novell.c:2858 msgid "Unknown" msgstr "Unbekannt" @@ -2040,49 +2039,49 @@ msgid "+++ %s signed off" msgstr "+++ %s hat sich abgemeldet" -#: ../src/conversation.c:161 +#: ../src/conversation.c:168 msgid "Unable to send message: The message is too large." msgstr "Nachricht kann nicht gesendet werden: Sie ist zu groß." -#: ../src/conversation.c:164 ../src/conversation.c:177 +#: ../src/conversation.c:171 ../src/conversation.c:184 #, c-format msgid "Unable to send message to %s." msgstr "Kann die Nachricht an %s nicht senden." -#: ../src/conversation.c:165 +#: ../src/conversation.c:172 msgid "The message is too large." msgstr "Die Nachricht ist zu lang." -#: ../src/conversation.c:174 +#: ../src/conversation.c:181 msgid "Unable to send message." msgstr "Nachricht kann nicht gesendet werden." -#: ../src/conversation.c:1515 +#: ../src/conversation.c:1510 #, c-format msgid "%s entered the room." msgstr "%s hat den Raum betreten." -#: ../src/conversation.c:1518 +#: ../src/conversation.c:1513 #, c-format msgid "%s [<I>%s</I>] entered the room." msgstr "%s [<I>%s</I>] hat den Raum betreten." -#: ../src/conversation.c:1625 +#: ../src/conversation.c:1620 #, c-format msgid "You are now known as %s" msgstr "Sie heißen jetzt %s" -#: ../src/conversation.c:1645 +#: ../src/conversation.c:1640 #, c-format msgid "%s is now known as %s" msgstr "%s heißt jetzt %s" -#: ../src/conversation.c:1718 +#: ../src/conversation.c:1713 #, c-format msgid "%s left the room." msgstr "%s hat den Raum verlassen." -#: ../src/conversation.c:1721 +#: ../src/conversation.c:1716 #, c-format msgid "%s left the room (%s)." msgstr "%s hat den Raum verlassen (%s)." @@ -2091,7 +2090,7 @@ msgid "No name" msgstr "Kein Name" -#: ../src/ft.c:189 ../src/protocols/msn/msn.c:412 +#: ../src/ft.c:189 ../src/protocols/msn/msn.c:410 #, c-format msgid "" "Error reading %s: \n" @@ -2158,60 +2157,60 @@ "Remote-Computer: %s\n" "Remote-Port: %d" -#: ../src/ft.c:391 +#: ../src/ft.c:392 #, c-format msgid "%s is offering to send file %s" msgstr "%s bietet an, die Datei %s zu senden" -#: ../src/ft.c:443 +#: ../src/ft.c:444 #, c-format msgid "%s is not a valid filename.\n" msgstr "%s ist kein gültiger Dateiname.\n" -#: ../src/ft.c:464 +#: ../src/ft.c:465 #, c-format msgid "Offering to send %s to %s" msgstr "Angebot zum Senden von %s an %s" -#: ../src/ft.c:476 +#: ../src/ft.c:477 #, c-format msgid "Starting transfer of %s from %s" msgstr "Starte die Dateiübertragung von %s von %s" -#: ../src/ft.c:630 +#: ../src/ft.c:631 #, c-format msgid "Transfer of file %s complete" msgstr "Übertragung der Datei %s ist komplett" -#: ../src/ft.c:633 +#: ../src/ft.c:634 msgid "File transfer complete" msgstr "Dateiübertragung ist komplett" -#: ../src/ft.c:1028 +#: ../src/ft.c:1031 #, c-format msgid "You canceled the transfer of %s" msgstr "Sie haben die Dateiübertragung von %s abgebrochen" -#: ../src/ft.c:1033 +#: ../src/ft.c:1036 msgid "File transfer cancelled" msgstr "Dateiübertragung wurde abgebrochen" -#: ../src/ft.c:1091 +#: ../src/ft.c:1094 #, c-format msgid "%s canceled the transfer of %s" msgstr "%s hat die Übertragung von %s abgebrochen" -#: ../src/ft.c:1096 +#: ../src/ft.c:1099 #, c-format msgid "%s canceled the file transfer" msgstr "%s hat die Datenübertragung abgebrochen" -#: ../src/ft.c:1153 +#: ../src/ft.c:1156 #, c-format msgid "File transfer to %s failed." msgstr "Dateiübertragung an %s wurde abgebrochen." -#: ../src/ft.c:1155 +#: ../src/ft.c:1158 #, c-format msgid "File transfer from %s failed." msgstr "Dateiübertragung von %s wurde abgebrochen." @@ -2240,7 +2239,7 @@ msgid "Password:" msgstr "Passwort:" -#: ../src/gtkaccount.c:863 ../src/gtkblist.c:4593 ../src/gtkblist.c:4959 +#: ../src/gtkaccount.c:863 ../src/gtkblist.c:4599 ../src/gtkblist.c:4965 msgid "Alias:" msgstr "Alias:" @@ -2333,7 +2332,7 @@ msgid "Add Account" msgstr "Konto hinzufügen" -#: ../src/gtkaccount.c:1749 ../src/gtkblist.c:3547 +#: ../src/gtkaccount.c:1749 ../src/gtkblist.c:3557 msgid "Modify Account" msgstr "Konto bearbeiten" @@ -2346,7 +2345,7 @@ msgstr "_Erweitert" #. Register button -#: ../src/gtkaccount.c:1797 ../src/protocols/jabber/jabber.c:823 +#: ../src/gtkaccount.c:1797 ../src/protocols/jabber/jabber.c:827 msgid "Register" msgstr "Anmelden" @@ -2355,12 +2354,12 @@ msgid "Are you sure you want to delete %s?" msgstr "Wollen Sie %s wirklich löschen?" -#: ../src/gtkaccount.c:2181 ../src/gtkpounce.c:1094 ../src/gtkrequest.c:273 +#: ../src/gtkaccount.c:2181 ../src/gtkpounce.c:1087 ../src/gtkrequest.c:273 #: ../src/gtksavedstatuses.c:295 msgid "Delete" msgstr "Löschen" -#: ../src/gtkaccount.c:2239 ../src/gtksavedstatuses.c:889 +#: ../src/gtkaccount.c:2239 ../src/gtksavedstatuses.c:893 #: ../src/protocols/oscar/oscar.c:2823 msgid "Screen Name" msgstr "Benutzername" @@ -2378,18 +2377,18 @@ msgid "Add buddy to your list?" msgstr "Benutzer zu Ihrer Buddy-Liste hinzufügen?" -#: ../src/gtkaccount.c:2648 ../src/gtkblist.c:5014 ../src/gtkconv.c:1623 +#: ../src/gtkaccount.c:2648 ../src/gtkblist.c:5020 ../src/gtkconv.c:1621 #: ../src/gtkrequest.c:274 ../src/protocols/gg/gg.c:870 #: ../src/protocols/oscar/oscar.c:2453 -#: ../src/protocols/sametime/sametime.c:5407 ../src/protocols/silc/chat.c:596 +#: ../src/protocols/sametime/sametime.c:5405 ../src/protocols/silc/chat.c:596 msgid "Add" msgstr "Hinzufügen" -#: ../src/gtkblist.c:664 +#: ../src/gtkblist.c:673 msgid "Join a Chat" msgstr "Chat betreten" -#: ../src/gtkblist.c:685 +#: ../src/gtkblist.c:694 msgid "" "Please enter the appropriate information about the chat you would like to " "join.\n" @@ -2397,87 +2396,87 @@ "Bitte geben Sie geeignete Informationen über den Chat ein, den Sie betreten " "wollen.\n" -#: ../src/gtkblist.c:696 ../src/gtkpounce.c:527 ../src/gtkroomlist.c:377 +#: ../src/gtkblist.c:705 ../src/gtkpounce.c:523 ../src/gtkroomlist.c:377 msgid "_Account:" msgstr "_Konto:" -#: ../src/gtkblist.c:940 +#: ../src/gtkblist.c:949 msgid "Get _Info" msgstr "_Info abrufen" -#: ../src/gtkblist.c:943 ../src/gtkstock.c:141 +#: ../src/gtkblist.c:952 ../src/gtkstock.c:141 msgid "I_M" msgstr "I_M" -#: ../src/gtkblist.c:949 +#: ../src/gtkblist.c:958 msgid "_Send File" msgstr "Datei ver_senden" -#: ../src/gtkblist.c:956 +#: ../src/gtkblist.c:965 msgid "Add Buddy _Pounce" msgstr "B_uddy-Alarm hinzufügen" -#: ../src/gtkblist.c:960 ../src/gtkblist.c:964 ../src/gtkblist.c:1063 -#: ../src/gtkblist.c:1086 +#: ../src/gtkblist.c:969 ../src/gtkblist.c:973 ../src/gtkblist.c:1072 +#: ../src/gtkblist.c:1095 msgid "View _Log" msgstr "Mi_tschnitt anzeigen" -#: ../src/gtkblist.c:975 +#: ../src/gtkblist.c:984 msgid "Alias..." msgstr "Alias..." -#: ../src/gtkblist.c:978 ../src/gtkconv.c:1620 ../src/gtkrequest.c:275 +#: ../src/gtkblist.c:987 ../src/gtkconv.c:1618 ../src/gtkrequest.c:275 msgid "Remove" msgstr "Entfernen" -#: ../src/gtkblist.c:984 ../src/gtkblist.c:1071 ../src/gtkblist.c:1092 +#: ../src/gtkblist.c:993 ../src/gtkblist.c:1080 ../src/gtkblist.c:1101 msgid "_Alias..." msgstr "_Alias..." -#: ../src/gtkblist.c:986 ../src/gtkblist.c:1073 ../src/gtkblist.c:1094 +#: ../src/gtkblist.c:995 ../src/gtkblist.c:1082 ../src/gtkblist.c:1103 msgid "_Remove" msgstr "_Entfernen" -#: ../src/gtkblist.c:1034 +#: ../src/gtkblist.c:1043 msgid "Add a _Buddy" msgstr "Buddy _hinzufügen" -#: ../src/gtkblist.c:1036 +#: ../src/gtkblist.c:1045 msgid "Add a C_hat" msgstr "C_hat hinzufügen" -#: ../src/gtkblist.c:1039 +#: ../src/gtkblist.c:1048 msgid "_Delete Group" msgstr "Gruppe _löschen" -#: ../src/gtkblist.c:1041 +#: ../src/gtkblist.c:1050 msgid "_Rename" msgstr "_Umbenennen" #. join button -#: ../src/gtkblist.c:1059 ../src/gtkroomlist.c:285 ../src/gtkroomlist.c:441 +#: ../src/gtkblist.c:1068 ../src/gtkroomlist.c:285 ../src/gtkroomlist.c:441 #: ../src/gtkstock.c:139 msgid "_Join" msgstr "_Betreten" -#: ../src/gtkblist.c:1061 +#: ../src/gtkblist.c:1070 msgid "Auto-Join" msgstr "Automatisch beitreten" -#: ../src/gtkblist.c:1099 ../src/gtkblist.c:1122 +#: ../src/gtkblist.c:1108 ../src/gtkblist.c:1131 msgid "_Collapse" msgstr "_Zusammenklappen" -#: ../src/gtkblist.c:1127 +#: ../src/gtkblist.c:1136 msgid "_Expand" msgstr "A_usklappen" -#: ../src/gtkblist.c:1373 ../src/gtkblist.c:1385 ../src/gtkblist.c:3808 -#: ../src/gtkblist.c:3818 +#: ../src/gtkblist.c:1382 ../src/gtkblist.c:1394 ../src/gtkblist.c:3817 +#: ../src/gtkblist.c:3827 msgid "/Tools/Mute Sounds" msgstr "/Werkzeuge/Stummschalten" -#: ../src/gtkblist.c:1845 ../src/gtkconv.c:4195 ../src/gtkpounce.c:426 +#: ../src/gtkblist.c:1859 ../src/gtkconv.c:4235 ../src/gtkpounce.c:422 msgid "" "You are not currently signed on with an account that can add that buddy." msgstr "" @@ -2485,126 +2484,126 @@ "kann, um diesen Buddy hinzuzufügen." #. Buddies menu -#: ../src/gtkblist.c:2419 +#: ../src/gtkblist.c:2433 msgid "/_Buddies" msgstr "/_Buddys" -#: ../src/gtkblist.c:2420 +#: ../src/gtkblist.c:2434 msgid "/Buddies/New Instant _Message..." msgstr "/Buddys/_Neue Sofortnachricht..." -#: ../src/gtkblist.c:2421 +#: ../src/gtkblist.c:2435 msgid "/Buddies/Join a _Chat..." msgstr "/Buddys/Einen _Chat betreten..." -#: ../src/gtkblist.c:2422 +#: ../src/gtkblist.c:2436 msgid "/Buddies/Get User _Info..." msgstr "/Buddys/B_enutzer-Info abrufen..." -#: ../src/gtkblist.c:2423 +#: ../src/gtkblist.c:2437 msgid "/Buddies/View User _Log..." msgstr "/Buddys/Benutzer-_Mitschnitt ansehen..." -#: ../src/gtkblist.c:2425 +#: ../src/gtkblist.c:2439 msgid "/Buddies/Show _Offline Buddies" msgstr "/Buddys/Zeige _offline Buddys" -#: ../src/gtkblist.c:2426 +#: ../src/gtkblist.c:2440 msgid "/Buddies/Show _Empty Groups" msgstr "/Buddys/Zeige _leere Gruppen" -#: ../src/gtkblist.c:2427 +#: ../src/gtkblist.c:2441 msgid "/Buddies/Show Buddy _Details" msgstr "/Buddys/Zeige Buddy-_Details" -#: ../src/gtkblist.c:2428 +#: ../src/gtkblist.c:2442 msgid "/Buddies/Show Idle _Times" msgstr "/Buddys/Zeige Untätigkeitszei_ten" -#: ../src/gtkblist.c:2429 +#: ../src/gtkblist.c:2443 msgid "/Buddies/_Sort Buddies" msgstr "/Buddys/Buddys _sortieren" -#: ../src/gtkblist.c:2431 +#: ../src/gtkblist.c:2445 msgid "/Buddies/_Add Buddy..." msgstr "/Buddys/B_uddy hinzufügen..." -#: ../src/gtkblist.c:2432 +#: ../src/gtkblist.c:2446 msgid "/Buddies/Add C_hat..." msgstr "/Buddys/C_hat hinzufügen..." -#: ../src/gtkblist.c:2433 +#: ../src/gtkblist.c:2447 msgid "/Buddies/Add _Group..." msgstr "/Buddys/_Gruppe hinzufügen..." -#: ../src/gtkblist.c:2435 +#: ../src/gtkblist.c:2449 msgid "/Buddies/_Quit" msgstr "/Buddys/_Beenden" #. Accounts menu -#: ../src/gtkblist.c:2438 +#: ../src/gtkblist.c:2452 msgid "/_Accounts" msgstr "/_Konten" -#: ../src/gtkblist.c:2439 ../src/gtkblist.c:5591 +#: ../src/gtkblist.c:2453 ../src/gtkblist.c:5597 msgid "/Accounts/Add\\/Edit" msgstr "/Konten/Hinzufügen\\/Ändern" #. Tools -#: ../src/gtkblist.c:2442 +#: ../src/gtkblist.c:2456 msgid "/_Tools" msgstr "/_Werkzeuge" -#: ../src/gtkblist.c:2443 +#: ../src/gtkblist.c:2457 msgid "/Tools/Buddy _Pounces" msgstr "/Werkzeuge/Buddy-_Alarm" -#: ../src/gtkblist.c:2444 +#: ../src/gtkblist.c:2458 msgid "/Tools/Plu_gins" msgstr "/Werkzeuge/Plu_gins" -#: ../src/gtkblist.c:2445 +#: ../src/gtkblist.c:2459 msgid "/Tools/Pr_eferences" msgstr "/Werkzeuge/_Einstellungen" -#: ../src/gtkblist.c:2446 +#: ../src/gtkblist.c:2460 msgid "/Tools/Pr_ivacy" msgstr "/Werkzeuge/Pri_vatsphäre" -#: ../src/gtkblist.c:2448 +#: ../src/gtkblist.c:2462 msgid "/Tools/_File Transfers" msgstr "/Werkzeuge/_Dateiübertragungen" -#: ../src/gtkblist.c:2449 +#: ../src/gtkblist.c:2463 msgid "/Tools/R_oom List" msgstr "/Werkzeuge/_Raumliste" -#: ../src/gtkblist.c:2450 +#: ../src/gtkblist.c:2464 msgid "/Tools/System _Log" msgstr "/Werkzeuge/_System-Mitschnitt" -#: ../src/gtkblist.c:2452 +#: ../src/gtkblist.c:2466 msgid "/Tools/Mute _Sounds" msgstr "/Werkzeuge/_Stummschalten" #. Help -#: ../src/gtkblist.c:2455 +#: ../src/gtkblist.c:2469 msgid "/_Help" msgstr "/_Hilfe" -#: ../src/gtkblist.c:2456 +#: ../src/gtkblist.c:2470 msgid "/Help/Online _Help" msgstr "/Hilfe/Online-_Hilfe" -#: ../src/gtkblist.c:2457 +#: ../src/gtkblist.c:2471 msgid "/Help/_Debug Window" msgstr "/Hilfe/_Debug-Fenster" -#: ../src/gtkblist.c:2458 +#: ../src/gtkblist.c:2472 msgid "/Help/_About" msgstr "/Hilfe/I_nfo" -#: ../src/gtkblist.c:2490 ../src/gtkblist.c:2559 +#: ../src/gtkblist.c:2504 ../src/gtkblist.c:2573 #, c-format msgid "" "\n" @@ -2613,7 +2612,7 @@ "\n" "<b>Konto:</b> %s" -#: ../src/gtkblist.c:2571 +#: ../src/gtkblist.c:2585 #, c-format msgid "" "\n" @@ -2622,7 +2621,7 @@ "\n" "<b>Buddy-Alias:</b> %s" -#: ../src/gtkblist.c:2583 +#: ../src/gtkblist.c:2597 #, c-format msgid "" "\n" @@ -2631,7 +2630,7 @@ "\n" "<b>Spitzname:</b> %s" -#: ../src/gtkblist.c:2592 +#: ../src/gtkblist.c:2606 #, c-format msgid "" "\n" @@ -2640,7 +2639,7 @@ "\n" "<b>Angemeldet:</b> %s" -#: ../src/gtkblist.c:2603 +#: ../src/gtkblist.c:2617 #, c-format msgid "" "\n" @@ -2649,7 +2648,7 @@ "\n" "<b>Untätig:</b> %s" -#: ../src/gtkblist.c:2638 +#: ../src/gtkblist.c:2652 #, c-format msgid "" "\n" @@ -2658,7 +2657,7 @@ "\n" "<b>Zuletzt gesehen:</b> vor %s" -#: ../src/gtkblist.c:2647 +#: ../src/gtkblist.c:2661 msgid "" "\n" "<b>Status:</b> Offline" @@ -2666,7 +2665,7 @@ "\n" "<b>Status:</b> Offline" -#: ../src/gtkblist.c:2658 +#: ../src/gtkblist.c:2672 msgid "" "\n" "<b>Description:</b> Spooky" @@ -2674,7 +2673,7 @@ "\n" "<b>Beschreibung:</b> Spooky" -#: ../src/gtkblist.c:2660 +#: ../src/gtkblist.c:2674 msgid "" "\n" "<b>Status:</b> Awesome" @@ -2682,7 +2681,7 @@ "\n" "<b>Status:</b> großartig" -#: ../src/gtkblist.c:2662 +#: ../src/gtkblist.c:2676 msgid "" "\n" "<b>Status:</b> Rockin'" @@ -2690,119 +2689,120 @@ "\n" "<b>Status:</b> Rockin'" -#: ../src/gtkblist.c:2951 +#: ../src/gtkblist.c:2967 #, c-format msgid "Idle %dh %02dm" msgstr "Untätig %dh %02dm" -#: ../src/gtkblist.c:2953 +#: ../src/gtkblist.c:2969 #, c-format msgid "Idle %dm" msgstr "Untätig %dm" #. Idle stuff -#: ../src/gtkblist.c:2956 ../src/gtkprefs.c:1760 -#: ../src/protocols/bonjour/bonjour.c:333 ../src/protocols/msn/msn.c:552 -#: ../src/protocols/msn/state.c:32 ../src/protocols/novell/novell.c:2854 -#: ../src/protocols/oscar/oscar.c:2844 ../src/protocols/yahoo/yahoo.c:2729 +#: ../src/gtkblist.c:2972 ../src/gtkprefs.c:1760 +#: ../src/protocols/bonjour/bonjour.c:333 ../src/protocols/jabber/buddy.c:641 +#: ../src/protocols/jabber/buddy.c:672 ../src/protocols/msn/msn.c:550 +#: ../src/protocols/msn/state.c:32 ../src/protocols/novell/novell.c:2852 +#: ../src/protocols/oscar/oscar.c:2844 ../src/protocols/yahoo/yahoo.c:2727 #: ../src/protocols/yahoo/yahoo_profile.c:691 msgid "Idle" msgstr "Untätig" -#: ../src/gtkblist.c:3088 +#: ../src/gtkblist.c:3104 msgid "/Buddies/New Instant Message..." msgstr "/Buddys/_Neue Sofortnachricht..." -#: ../src/gtkblist.c:3089 ../src/gtkblist.c:3122 +#: ../src/gtkblist.c:3105 ../src/gtkblist.c:3138 msgid "/Buddies/Join a Chat..." msgstr "/Buddys/Chat betreten..." -#: ../src/gtkblist.c:3090 +#: ../src/gtkblist.c:3106 msgid "/Buddies/Get User Info..." msgstr "/Buddys/B_enutzer-Info abrufen..." -#: ../src/gtkblist.c:3091 +#: ../src/gtkblist.c:3107 msgid "/Buddies/Add Buddy..." msgstr "/Buddys/B_uddy hinzufügen..." -#: ../src/gtkblist.c:3092 ../src/gtkblist.c:3125 +#: ../src/gtkblist.c:3108 ../src/gtkblist.c:3141 msgid "/Buddies/Add Chat..." msgstr "/Buddys/C_hat hinzufügen..." -#: ../src/gtkblist.c:3093 +#: ../src/gtkblist.c:3109 msgid "/Buddies/Add Group..." msgstr "/Buddys/Gruppe hinzufügen..." -#: ../src/gtkblist.c:3128 +#: ../src/gtkblist.c:3144 msgid "/Tools/Buddy Pounces" msgstr "/Werkzeuge/Buddy-Alarm" -#: ../src/gtkblist.c:3131 +#: ../src/gtkblist.c:3147 msgid "/Tools/Privacy" msgstr "/Werkzeuge/Privatsphäre" -#: ../src/gtkblist.c:3134 +#: ../src/gtkblist.c:3150 msgid "/Tools/Room List" msgstr "/Werkzeuge/Raumliste" -#: ../src/gtkblist.c:3328 +#: ../src/gtkblist.c:3344 msgid "Manually" msgstr "Manuell" -#: ../src/gtkblist.c:3330 +#: ../src/gtkblist.c:3346 msgid "Alphabetically" msgstr "Alphabetisch" -#: ../src/gtkblist.c:3331 +#: ../src/gtkblist.c:3347 msgid "By status" msgstr "Nach Status" -#: ../src/gtkblist.c:3332 +#: ../src/gtkblist.c:3348 msgid "By log size" msgstr "Nach Größe der Logs" -#: ../src/gtkblist.c:3532 ../src/gtkconn.c:196 +#: ../src/gtkblist.c:3549 ../src/gtkconn.c:184 #, c-format msgid "%s disconnected" msgstr "%s abgemeldet" -#: ../src/gtkblist.c:3548 ../src/protocols/sametime/sametime.c:3629 +#: ../src/gtkblist.c:3558 ../src/protocols/sametime/sametime.c:3622 msgid "Connect" msgstr "Verbinden" -#: ../src/gtkblist.c:3548 +#: ../src/gtkblist.c:3558 msgid "Re-enable Account" msgstr "Konten reaktivieren" -#: ../src/gtkblist.c:3570 +#: ../src/gtkblist.c:3579 #, c-format msgid "<span color=\"red\">%s disconnected: %s</span>" msgstr "<span color=\"red\">%s abgemeldet: %s</span>" -#: ../src/gtkblist.c:3697 +#: ../src/gtkblist.c:3706 msgid "/Accounts" msgstr "/Konten" #. set the Show Offline Buddies option. must be done #. * after the treeview or faceprint gets mad. -Robot101 #. -#: ../src/gtkblist.c:3802 +#: ../src/gtkblist.c:3811 msgid "/Buddies/Show Offline Buddies" msgstr "/Buddys/Zeige Offline Buddys" -#: ../src/gtkblist.c:3805 +#: ../src/gtkblist.c:3814 msgid "/Buddies/Show Empty Groups" msgstr "/Buddys/Zeige leere Gruppen" -#: ../src/gtkblist.c:3811 +#: ../src/gtkblist.c:3820 msgid "/Buddies/Show Buddy Details" msgstr "/Buddys/Zeige Buddy-Details" -#: ../src/gtkblist.c:3814 +#: ../src/gtkblist.c:3823 msgid "/Buddies/Show Idle Times" msgstr "/Buddys/Zeige Untätigkeitszeiten" -#: ../src/gtkblist.c:4550 +#: ../src/gtkblist.c:4556 msgid "" "Please enter the screen name of the person you would like to add to your " "buddy list. You may optionally enter an alias, or nickname, for the buddy. " @@ -2814,25 +2814,25 @@ "immer es möglich ist.\n" #. Set up stuff for the account box -#: ../src/gtkblist.c:4620 ../src/gtkblist.c:4939 +#: ../src/gtkblist.c:4626 ../src/gtkblist.c:4945 msgid "Account:" msgstr "Konto:" -#: ../src/gtkblist.c:4872 +#: ../src/gtkblist.c:4878 msgid "This protocol does not support chat rooms." msgstr "Dieses Protokoll unterstützt keine Chaträume." -#: ../src/gtkblist.c:4888 +#: ../src/gtkblist.c:4894 msgid "" "You are not currently signed on with any protocols that have the ability to " "chat." msgstr "Sie sind derzeit mit keinem Chat-fähigen Protokoll angemeldet." -#: ../src/gtkblist.c:4905 +#: ../src/gtkblist.c:4911 msgid "Add Chat" msgstr "Chat hinzufügen" -#: ../src/gtkblist.c:4929 +#: ../src/gtkblist.c:4935 msgid "" "Please enter an alias, and the appropriate information about the chat you " "would like to add to your buddy list.\n" @@ -2840,40 +2840,40 @@ "Bitte geben Sie einen Alias und geeignete Informationen über den Chat ein, " "den Sie in Ihre Buddy-Liste aufnehmen wollen.\n" -#: ../src/gtkblist.c:5011 ../src/protocols/sametime/sametime.c:5318 -#: ../src/protocols/sametime/sametime.c:5405 +#: ../src/gtkblist.c:5017 ../src/protocols/sametime/sametime.c:5316 +#: ../src/protocols/sametime/sametime.c:5403 msgid "Add Group" msgstr "Gruppe hinzufügen" -#: ../src/gtkblist.c:5012 +#: ../src/gtkblist.c:5018 msgid "Please enter the name of the group to be added." msgstr "Bitte geben Sie den Namen der Gruppe ein, die hinzugefügt werden soll." -#: ../src/gtkblist.c:5631 +#: ../src/gtkblist.c:5637 msgid "_Edit Account" msgstr "Konto _bearbeiten" -#: ../src/gtkblist.c:5664 ../src/gtkblist.c:5670 +#: ../src/gtkblist.c:5670 ../src/gtkblist.c:5676 ../src/gtkconv.c:2747 msgid "No actions available" msgstr "Keine Aktionen verfügbar" -#: ../src/gtkblist.c:5678 +#: ../src/gtkblist.c:5684 msgid "_Disable" msgstr "_Deaktivieren" -#: ../src/gtkblist.c:5690 +#: ../src/gtkblist.c:5696 msgid "Enable Account" msgstr "Konten aktivieren" -#: ../src/gtkblist.c:5743 +#: ../src/gtkblist.c:5749 msgid "/Tools" msgstr "/Werkzeuge" -#: ../src/gtkblist.c:5829 +#: ../src/gtkblist.c:5835 msgid "/Buddies/Sort Buddies" msgstr "/Buddys/Buddys _sortieren" -#: ../src/gtkconn.c:197 +#: ../src/gtkconn.c:185 #, c-format msgid "" "%s was disconnected due to an error: %s\n" @@ -2901,48 +2901,48 @@ "zu erhalten.\n" "Die folgenden Kommandos sind in diesem Kontext verfügbar:\n" -#: ../src/gtkconv.c:482 +#: ../src/gtkconv.c:478 msgid "No such command." msgstr "Es gibt kein solches Kommando." -#: ../src/gtkconv.c:489 +#: ../src/gtkconv.c:485 msgid "Syntax Error: You typed the wrong number of arguments to that command." msgstr "" "Syntaxfehler: Sie übergaben dem Kommando eine falsche Anzahl von Argumenten." -#: ../src/gtkconv.c:494 +#: ../src/gtkconv.c:490 msgid "Your command failed for an unknown reason." msgstr "Ihre Kommando scheiterte aus einem unbekannten Grund." -#: ../src/gtkconv.c:501 +#: ../src/gtkconv.c:497 msgid "That command only works in chats, not IMs." msgstr "Dieses Kommando funktioniert nur in Chats, nicht bei IMs." -#: ../src/gtkconv.c:504 +#: ../src/gtkconv.c:500 msgid "That command only works in IMs, not chats." msgstr "Dieses Kommando funktioniert nur bei IMs, nicht bei Chats." -#: ../src/gtkconv.c:508 +#: ../src/gtkconv.c:504 msgid "That command doesn't work on this protocol." msgstr "Dieses Kommando funktioniert nicht in diesem Protokoll." -#: ../src/gtkconv.c:742 ../src/gtkconv.c:768 +#: ../src/gtkconv.c:739 ../src/gtkconv.c:765 msgid "That buddy is not on the same protocol as this chat." msgstr "Der Buddy hat nicht das gleiche Protokoll wie dieser Chat." -#: ../src/gtkconv.c:762 +#: ../src/gtkconv.c:759 msgid "" "You are not currently signed on with an account that can invite that buddy." msgstr "" "Sie sind im Moment nicht mit einem Konto angemeldet, welches benutzt werden " "kann, um diesen Buddy einzuladen." -#: ../src/gtkconv.c:815 +#: ../src/gtkconv.c:812 msgid "Invite Buddy Into Chat Room" msgstr "Buddy in einen Chatraum einladen" #. Put our happy label in it. -#: ../src/gtkconv.c:845 +#: ../src/gtkconv.c:842 msgid "" "Please enter the name of the user you wish to invite, along with an optional " "invite message." @@ -2950,318 +2950,330 @@ "Bitte geben Sie den Benutzernamen der Person ein, die Sie einladen möchten " "zusammen mit einer optionalen Einladungsnachricht." -#: ../src/gtkconv.c:866 +#: ../src/gtkconv.c:863 msgid "_Buddy:" msgstr "_Buddy:" -#: ../src/gtkconv.c:886 ../src/gtksavedstatuses.c:1107 -#: ../src/gtksavedstatuses.c:1443 +#: ../src/gtkconv.c:883 ../src/gtksavedstatuses.c:1111 +#: ../src/gtksavedstatuses.c:1447 msgid "_Message:" msgstr "_Nachricht:" -#: ../src/gtkconv.c:943 ../src/gtkconv.c:2378 ../src/gtkdebug.c:217 +#: ../src/gtkconv.c:940 ../src/gtkconv.c:2364 ../src/gtkdebug.c:217 #: ../src/gtkft.c:490 msgid "Unable to open file." msgstr "Konnte die Datei nicht öffnen." -#: ../src/gtkconv.c:949 +#: ../src/gtkconv.c:946 #, c-format msgid "<h1>Conversation with %s</h1>\n" msgstr "<h1>Unterhaltung mit %s</h1>\n" -#: ../src/gtkconv.c:973 +#: ../src/gtkconv.c:970 msgid "Save Conversation" msgstr "Unterhaltung speichern" -#: ../src/gtkconv.c:1094 ../src/gtkdebug.c:165 ../src/gtkdebug.c:678 +#: ../src/gtkconv.c:1091 ../src/gtkdebug.c:165 ../src/gtkdebug.c:678 msgid "Find" msgstr "Suchen" -#: ../src/gtkconv.c:1120 ../src/gtkdebug.c:193 +#: ../src/gtkconv.c:1117 ../src/gtkdebug.c:193 msgid "_Search for:" msgstr "_Suche nach:" -#: ../src/gtkconv.c:1291 +#: ../src/gtkconv.c:1288 msgid "Logging started. Future messages in this conversation will be logged." msgstr "" "Mitschnitt gestartet. Zukünftige Nachrichten dieser Unterhaltung werden " "mitgeschnitten." -#: ../src/gtkconv.c:1299 +#: ../src/gtkconv.c:1296 msgid "" "Logging stopped. Future messages in this conversation will not be logged." msgstr "" "Mitschnitt angehalten. Zukünftige Nachrichten dieser Unterhaltung werden " "nicht mitgeschnitten." -#: ../src/gtkconv.c:1560 +#: ../src/gtkconv.c:1558 msgid "IM" msgstr "Nachricht" -#: ../src/gtkconv.c:1571 ../src/protocols/oscar/oscar.c:640 +#: ../src/gtkconv.c:1569 ../src/protocols/oscar/oscar.c:640 msgid "Send File" msgstr "Datei versenden" -#: ../src/gtkconv.c:1586 +#: ../src/gtkconv.c:1584 msgid "Un-Ignore" msgstr "Nicht Ignorieren" -#: ../src/gtkconv.c:1589 +#: ../src/gtkconv.c:1587 msgid "Ignore" msgstr "Ignorieren" -#: ../src/gtkconv.c:1599 +#: ../src/gtkconv.c:1597 msgid "Info" msgstr "Info" -#: ../src/gtkconv.c:1609 +#: ../src/gtkconv.c:1607 msgid "Get Away Message" msgstr "Neue Abwesenheitsnachricht abholen" -#: ../src/gtkconv.c:1632 +#: ../src/gtkconv.c:1630 msgid "Last said" msgstr "Zuletzt gesagt" -#: ../src/gtkconv.c:2386 +#: ../src/gtkconv.c:2372 msgid "Unable to save icon file to disk." msgstr "Kann Icon-Datei nicht auf die Festplatte speichern." -#: ../src/gtkconv.c:2410 +#: ../src/gtkconv.c:2396 msgid "Save Icon" msgstr "Icon speichern" -#: ../src/gtkconv.c:2459 +#: ../src/gtkconv.c:2445 msgid "Animate" msgstr "Animieren" -#: ../src/gtkconv.c:2464 +#: ../src/gtkconv.c:2450 msgid "Hide Icon" msgstr "Icon verbergen" -#: ../src/gtkconv.c:2470 +#: ../src/gtkconv.c:2456 msgid "Save Icon As..." msgstr "Icon speichern unter..." #. Conversation menu -#: ../src/gtkconv.c:2611 +#: ../src/gtkconv.c:2596 msgid "/_Conversation" msgstr "/_Unterhaltung" -#: ../src/gtkconv.c:2613 +#: ../src/gtkconv.c:2598 msgid "/Conversation/New Instant _Message..." msgstr "/Unterhaltung/_Neue Sofortnachricht..." -#: ../src/gtkconv.c:2618 +#: ../src/gtkconv.c:2603 msgid "/Conversation/_Find..." msgstr "/Unterhaltung/_Finden..." -#: ../src/gtkconv.c:2620 +#: ../src/gtkconv.c:2605 msgid "/Conversation/View _Log" msgstr "/Unterhaltung/Betrachte _Mitschnitt" -#: ../src/gtkconv.c:2621 +#: ../src/gtkconv.c:2606 msgid "/Conversation/_Save As..." msgstr "/Unterhaltung/_Speichern als..." -#: ../src/gtkconv.c:2623 +#: ../src/gtkconv.c:2608 msgid "/Conversation/Clea_r Scrollback" msgstr "/Unterhaltung/_Leeren" -#: ../src/gtkconv.c:2627 +#: ../src/gtkconv.c:2612 msgid "/Conversation/Se_nd File..." msgstr "/Unterhaltung/Datei _senden..." -#: ../src/gtkconv.c:2628 +#: ../src/gtkconv.c:2613 msgid "/Conversation/Add Buddy _Pounce..." msgstr "/Unterhaltung/Buddy-Alar_m hinzufügen..." -#: ../src/gtkconv.c:2630 +#: ../src/gtkconv.c:2615 msgid "/Conversation/_Get Info" msgstr "/Unterhaltung/B_enutzer-Info abrufen" -#: ../src/gtkconv.c:2632 +#: ../src/gtkconv.c:2617 msgid "/Conversation/In_vite..." msgstr "/Unterhaltung/_Einladen..." -#: ../src/gtkconv.c:2637 +#: ../src/gtkconv.c:2619 +msgid "/Conversation/M_ore" +msgstr "/Unterhaltung/M_ehr" + +#: ../src/gtkconv.c:2623 msgid "/Conversation/Al_ias..." msgstr "/Unterhaltung/Al_ias..." -#: ../src/gtkconv.c:2639 +#: ../src/gtkconv.c:2625 msgid "/Conversation/_Block..." msgstr "/Unterhaltung/_Blockieren..." -#: ../src/gtkconv.c:2641 +#: ../src/gtkconv.c:2627 msgid "/Conversation/_Add..." msgstr "/Unterhaltung/_Hinzufügen..." -#: ../src/gtkconv.c:2643 +#: ../src/gtkconv.c:2629 msgid "/Conversation/_Remove..." msgstr "/Unterhaltung/_Entfernen..." -#: ../src/gtkconv.c:2648 +#: ../src/gtkconv.c:2634 msgid "/Conversation/Insert Lin_k..." msgstr "/Unterhaltung/Füge Lin_k ein..." -#: ../src/gtkconv.c:2650 +#: ../src/gtkconv.c:2636 msgid "/Conversation/Insert Imag_e..." msgstr "/Unterhaltung/Füge Bil_d ein ..." -#: ../src/gtkconv.c:2655 +#: ../src/gtkconv.c:2641 msgid "/Conversation/_Close" msgstr "/Unterhaltung/S_chließen" #. Options -#: ../src/gtkconv.c:2659 +#: ../src/gtkconv.c:2645 msgid "/_Options" msgstr "/_Optionen" -#: ../src/gtkconv.c:2660 +#: ../src/gtkconv.c:2646 msgid "/Options/Enable _Logging" msgstr "/Optionen/Schalte _Mitschnitt ein" -#: ../src/gtkconv.c:2661 +#: ../src/gtkconv.c:2647 msgid "/Options/Enable _Sounds" msgstr "/Optionen/Schalte _Klänge ein" -#: ../src/gtkconv.c:2662 +#: ../src/gtkconv.c:2648 msgid "/Options/Show Buddy _Icon" msgstr "/Optionen/Buddy-_Icon anzeigen" -#: ../src/gtkconv.c:2664 +#: ../src/gtkconv.c:2650 msgid "/Options/Show Formatting _Toolbars" msgstr "/Optionen/Zeige _Werkzeugleisten für Formatierung" -#: ../src/gtkconv.c:2665 +#: ../src/gtkconv.c:2651 msgid "/Options/Show Ti_mestamps" msgstr "/Optionen/Zeige Zeitste_mpel" -#: ../src/gtkconv.c:2757 +#: ../src/gtkconv.c:2726 +msgid "/Conversation/More" +msgstr "/Unterhaltung/Mehr" + +#: ../src/gtkconv.c:2764 ../src/gtkconv.c:2791 +msgid "/Conversation" +msgstr "/Unterhaltung" + +#: ../src/gtkconv.c:2801 msgid "/Conversation/View Log" msgstr "/Unterhaltung/Betrachte Mitschnitt" -#: ../src/gtkconv.c:2763 +#: ../src/gtkconv.c:2807 msgid "/Conversation/Send File..." msgstr "/Unterhaltung/Datei senden ..." -#: ../src/gtkconv.c:2767 +#: ../src/gtkconv.c:2811 msgid "/Conversation/Add Buddy Pounce..." msgstr "/Unterhaltung/Buddy-Alarm hinzufügen..." -#: ../src/gtkconv.c:2773 +#: ../src/gtkconv.c:2817 msgid "/Conversation/Get Info" msgstr "/Unterhaltung/Info abrufen" -#: ../src/gtkconv.c:2777 +#: ../src/gtkconv.c:2821 msgid "/Conversation/Invite..." msgstr "/Unterhaltung/Einladen ..." -#: ../src/gtkconv.c:2783 +#: ../src/gtkconv.c:2827 msgid "/Conversation/Alias..." msgstr "/Unterhaltung/Alias..." -#: ../src/gtkconv.c:2787 +#: ../src/gtkconv.c:2831 msgid "/Conversation/Block..." msgstr "/Unterhaltung/Blockieren..." -#: ../src/gtkconv.c:2791 +#: ../src/gtkconv.c:2835 msgid "/Conversation/Add..." msgstr "/Unterhaltung/Hinzufügen..." -#: ../src/gtkconv.c:2795 +#: ../src/gtkconv.c:2839 msgid "/Conversation/Remove..." msgstr "/Unterhaltung/Entfernen..." -#: ../src/gtkconv.c:2801 +#: ../src/gtkconv.c:2845 msgid "/Conversation/Insert Link..." msgstr "/Unterhaltung/Füge Link ein..." -#: ../src/gtkconv.c:2805 +#: ../src/gtkconv.c:2849 msgid "/Conversation/Insert Image..." msgstr "/Unterhaltung/Füge Bild ein ..." -#: ../src/gtkconv.c:2811 +#: ../src/gtkconv.c:2855 msgid "/Options/Enable Logging" msgstr "/Optionen/Schalte Mitschnitt ein" -#: ../src/gtkconv.c:2814 +#: ../src/gtkconv.c:2858 msgid "/Options/Enable Sounds" msgstr "/Optionen/Schalte Klänge ein" -#: ../src/gtkconv.c:2827 +#: ../src/gtkconv.c:2871 msgid "/Options/Show Formatting Toolbars" msgstr "/Optionen/Zeige Werkzeugleisten für Formatierung" -#: ../src/gtkconv.c:2830 +#: ../src/gtkconv.c:2874 msgid "/Options/Show Timestamps" msgstr "/Optionen/Zeige Zeitstempel" -#: ../src/gtkconv.c:2833 +#: ../src/gtkconv.c:2877 msgid "/Options/Show Buddy Icon" msgstr "/Optionen/Zeige Buddy-Icon" -#: ../src/gtkconv.c:2913 +#: ../src/gtkconv.c:2953 msgid "User is typing..." msgstr "Benutzer tippt gerade..." -#: ../src/gtkconv.c:2916 +#: ../src/gtkconv.c:2956 msgid "User has typed something and stopped" msgstr "Benutzer hat etwas getippt und wartet nun" #. Build the Send To menu -#: ../src/gtkconv.c:3099 +#: ../src/gtkconv.c:3139 msgid "_Send To" msgstr "_Senden an" -#: ../src/gtkconv.c:3751 +#: ../src/gtkconv.c:3791 msgid "_Send" msgstr "Ab_schicken" -#: ../src/gtkconv.c:3806 ../src/protocols/sametime/sametime.c:3571 +#: ../src/gtkconv.c:3846 ../src/protocols/sametime/sametime.c:3564 msgid "Topic:" msgstr "Thema:" #. Setup the label telling how many people are in the room. -#: ../src/gtkconv.c:3858 +#: ../src/gtkconv.c:3898 msgid "0 people in room" msgstr "0 Personen im Raum" -#: ../src/gtkconv.c:3937 +#: ../src/gtkconv.c:3977 msgid "IM the user" msgstr "Benutzer eine IM schicken" -#: ../src/gtkconv.c:3950 +#: ../src/gtkconv.c:3990 msgid "Ignore the user" msgstr "Benutzer ignorieren" -#: ../src/gtkconv.c:3962 +#: ../src/gtkconv.c:4002 msgid "Get the user's information" msgstr "Information zum Benutzer abrufen" -#: ../src/gtkconv.c:4944 ../src/gtkconv.c:5053 +#: ../src/gtkconv.c:4993 ../src/gtkconv.c:5102 #, c-format msgid "%d person in room" msgid_plural "%d people in room" msgstr[0] "%d Person im Raum" msgstr[1] "%d Personen im Raum" -#: ../src/gtkconv.c:5610 ../src/gtkstatusbox.c:366 +#: ../src/gtkconv.c:5659 ../src/gtkstatusbox.c:366 msgid "Typing" msgstr "Tippt gerade" -#: ../src/gtkconv.c:5616 +#: ../src/gtkconv.c:5665 msgid "Stopped Typing" msgstr "Tippen gestoppt" -#: ../src/gtkconv.c:5621 +#: ../src/gtkconv.c:5670 msgid "Nick Said" msgstr "Spitzname gesagt" -#: ../src/gtkconv.c:5631 +#: ../src/gtkconv.c:5680 msgid "New Event" msgstr "Neue Ereignisse" -#: ../src/gtkconv.c:6521 +#: ../src/gtkconv.c:6570 msgid "" "say <message>: Send a message normally as if you weren't using a " "command." @@ -3269,13 +3281,13 @@ "say <Nachricht>: Sendet eine Nachricht genau so, als wenn Sie die " "Nachricht ohne ein Kommando absenden." -#: ../src/gtkconv.c:6524 +#: ../src/gtkconv.c:6573 msgid "me <action>: Send an IRC style action to a buddy or chat." msgstr "" "me <Aktion>: Sende eine IRC-ähnliche Aktion an einen Buddy oder einen " "Chat." -#: ../src/gtkconv.c:6527 +#: ../src/gtkconv.c:6576 msgid "" "debug <option>: Send various debug information to the current " "conversation." @@ -3283,60 +3295,60 @@ "debug <Option>: Verschiedene Debugging-Informationen zur aktuellen " "Unterhaltung senden." -#: ../src/gtkconv.c:6530 +#: ../src/gtkconv.c:6579 msgid "clear: Clears the conversation scrollback." msgstr "clear: Leert das Gesprächsfenster." -#: ../src/gtkconv.c:6533 +#: ../src/gtkconv.c:6582 msgid "help <command>: Help on a specific command." msgstr "help <Kommando>: Hilfe zu einem bestimmten Kommando." -#: ../src/gtkconv.c:6692 +#: ../src/gtkconv.c:6741 msgid "Confirm close" msgstr "Schließen bestätigen" -#: ../src/gtkconv.c:6724 +#: ../src/gtkconv.c:6773 msgid "You have unread messages. Are you sure you want to close the window?" msgstr "" "Sie haben ungelesene Nachrichten. Wollen Sie das Fenster wirklich schließen?" -#: ../src/gtkconv.c:7246 +#: ../src/gtkconv.c:7295 msgid "Close other tabs" msgstr "Andere Reiter schließen" -#: ../src/gtkconv.c:7252 +#: ../src/gtkconv.c:7301 msgid "Close all tabs" msgstr "Alle Reiter schließen" -#: ../src/gtkconv.c:7260 +#: ../src/gtkconv.c:7309 msgid "Detach this tab" msgstr "Diesen Reiter ablösen" -#: ../src/gtkconv.c:7266 +#: ../src/gtkconv.c:7315 msgid "Close this tab" msgstr "Diesen Reiter schließen" -#: ../src/gtkconv.c:7526 +#: ../src/gtkconv.c:7575 msgid "Close conversation" msgstr "Unterhaltung schließen" -#: ../src/gtkconv.c:7990 +#: ../src/gtkconv.c:8039 msgid "Last created window" msgstr "Letztes erstelltes Fenster" -#: ../src/gtkconv.c:7992 +#: ../src/gtkconv.c:8041 msgid "Separate IM and Chat windows" msgstr "Getrennte IM- und Chat-Fenster" -#: ../src/gtkconv.c:7994 ../src/gtkprefs.c:1258 +#: ../src/gtkconv.c:8043 ../src/gtkprefs.c:1258 msgid "New window" msgstr "Neues Fenster" -#: ../src/gtkconv.c:7996 +#: ../src/gtkconv.c:8045 msgid "By group" msgstr "Nach Gruppe" -#: ../src/gtkconv.c:7998 +#: ../src/gtkconv.c:8047 msgid "By account" msgstr "Nach Konto" @@ -3421,7 +3433,7 @@ msgid "original author" msgstr "Originalautor" -#: ../src/gtkdialogs.c:110 ../src/gtkdialogs.c:111 ../src/gtkdialogs.c:169 +#: ../src/gtkdialogs.c:110 ../src/gtkdialogs.c:111 ../src/gtkdialogs.c:174 msgid "Bulgarian" msgstr "Bulgarisch" @@ -3433,186 +3445,194 @@ msgid "Bosnian" msgstr "Bosnisch" -#: ../src/gtkdialogs.c:115 ../src/gtkdialogs.c:170 ../src/gtkdialogs.c:171 +#: ../src/gtkdialogs.c:115 ../src/gtkdialogs.c:175 ../src/gtkdialogs.c:176 msgid "Catalan" msgstr "Katalanisch" -#: ../src/gtkdialogs.c:116 -msgid "Valencian" -msgstr "Valencianisch" +#: ../src/gtkdialogs.c:116 ../src/gtkdialogs.c:117 +msgid "Valencian-Catalan" +msgstr "Valencianisch-Katalanisch" -#: ../src/gtkdialogs.c:117 ../src/gtkdialogs.c:172 +#: ../src/gtkdialogs.c:118 ../src/gtkdialogs.c:177 msgid "Czech" msgstr "Tschechisch" -#: ../src/gtkdialogs.c:118 +#: ../src/gtkdialogs.c:119 msgid "Danish" msgstr "Dänisch" -#: ../src/gtkdialogs.c:119 ../src/gtkdialogs.c:120 ../src/gtkdialogs.c:173 +#: ../src/gtkdialogs.c:120 ../src/gtkdialogs.c:121 ../src/gtkdialogs.c:178 msgid "German" msgstr "Deutsch" -#: ../src/gtkdialogs.c:121 ../src/gtkdialogs.c:122 +#: ../src/gtkdialogs.c:122 ../src/gtkdialogs.c:123 msgid "Greek" msgstr "Griechisch" -#: ../src/gtkdialogs.c:123 +#: ../src/gtkdialogs.c:124 msgid "Australian English" msgstr "Australisches Englisch" -#: ../src/gtkdialogs.c:124 +#: ../src/gtkdialogs.c:125 msgid "Canadian English" msgstr "Kanadisches Englisch" -#: ../src/gtkdialogs.c:125 +#: ../src/gtkdialogs.c:126 msgid "British English" msgstr "Britisches Englisch" -#: ../src/gtkdialogs.c:126 ../src/gtkdialogs.c:174 ../src/gtkdialogs.c:175 -#: ../src/gtkdialogs.c:176 ../src/gtkdialogs.c:177 +#: ../src/gtkdialogs.c:127 ../src/gtkdialogs.c:179 ../src/gtkdialogs.c:180 +#: ../src/gtkdialogs.c:181 ../src/gtkdialogs.c:182 msgid "Spanish" msgstr "Spanisch" -#: ../src/gtkdialogs.c:127 ../src/gt... [truncated message content] |
From: <the...@us...> - 2006-08-12 22:18:34
|
Revision: 16729 Author: thekingant Date: 2006-08-12 15:18:28 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16729&view=rev Log Message: ----------- Backport SVN revisions 16725 through 16728 from HEAD to v2_0_0 Original commit messages: 16725: Rename "phb" to "connect_info" everywhere 16726: Use the GaimProxyConnectInfo typedef instead of struct _GaimProxyConnectInfo. Sorry, I should have done this in one of my other commits 16727: I decided that it's probably not a good idea to enable_fatal_asserts when --enable-debug is passed to autogen.sh/configure. However, EVERY Gaim dev, summer of code student and crazy patch writer should pass "--enable-fatal-asserts" to Gaim's autogen.sh/configure (It causes Gaim to segfault when g_return_val_if_fail() fails) 16728: Extremely minor error message improvements Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/plugins/ChangeLog.API branches/v2_0_0/src/proxy.c Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-08-12 22:16:23 UTC (rev 16728) +++ branches/v2_0_0/configure.ac 2006-08-12 22:18:28 UTC (rev 16729) @@ -542,7 +542,6 @@ if test "x$enable_debug" = "xyes" ; then AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.]) - enable_fatal_asserts="yes" fi if test "x$enable_fatal_asserts" = "xyes" ; then @@ -1816,9 +1815,10 @@ echo echo Use XScreenSaver Extension.... : $enable_xss echo Use X Session Management...... : $enable_sm -echo Use startup notification.......: $enable_startup_notification +echo Use startup notification...... : $enable_startup_notification echo echo Print debugging messages...... : $enable_debug +echo Assertions are fatal.......... : $enable_fatal_asserts echo eval eval echo Gaim will be installed in $bindir. if test "x$gaimpath" != "x" ; then Modified: branches/v2_0_0/plugins/ChangeLog.API =================================================================== --- branches/v2_0_0/plugins/ChangeLog.API 2006-08-12 22:16:23 UTC (rev 16728) +++ branches/v2_0_0/plugins/ChangeLog.API 2006-08-12 22:18:28 UTC (rev 16729) @@ -114,6 +114,9 @@ * All network activity has been updated to use non-blocking sockets. This means that plugins must be updated to expect such a socket from gaim_proxy_connect() and gaim_network_listen*(). + * gaim_proxy_connect(): changed to return NULL on error and a void * + handle on success, and changed parameters. It is now possible to + cancel connection attempts. * gaim_gtk_create_imhtml(): Added sw_ret() parameter * gaim_account_get_log(): Added create parameter * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH Modified: branches/v2_0_0/src/proxy.c =================================================================== --- branches/v2_0_0/src/proxy.c 2006-08-12 22:16:23 UTC (rev 16728) +++ branches/v2_0_0/src/proxy.c 2006-08-12 22:18:28 UTC (rev 16729) @@ -38,7 +38,6 @@ #include "proxy.h" #include "util.h" -/* Does anyone know what PHB stands for? */ struct _GaimProxyConnectInfo { GaimProxyConnectFunction connect_cb; GaimProxyErrorFunction error_cb; @@ -47,7 +46,13 @@ int port; guint inpa; GaimProxyInfo *gpi; + + /** + * This contains alternating length/char* values. The char* + * values need to be freed when removed from the linked list. + */ GSList *hosts; + guchar *write_buffer; gsize write_buf_len; gsize written_len; @@ -70,9 +75,9 @@ }; static GaimProxyInfo *global_proxy_info = NULL; -static GSList *phbs = NULL; +static GSList *connect_infos = NULL; -static void try_connect(struct _GaimProxyConnectInfo *); +static void try_connect(GaimProxyConnectInfo *); /************************************************************************** * Proxy structure API @@ -258,33 +263,33 @@ **************************************************************************/ static void -gaim_proxy_phb_destroy(struct _GaimProxyConnectInfo *phb) +gaim_proxy_connect_info_destroy(GaimProxyConnectInfo *connect_info) { - phbs = g_slist_remove(phbs, phb); + connect_infos = g_slist_remove(connect_infos, connect_info); - if (phb->inpa > 0) - gaim_input_remove(phb->inpa); + if (connect_info->inpa > 0) + gaim_input_remove(connect_info->inpa); - while (phb->hosts != NULL) + while (connect_info->hosts != NULL) { /* Discard the length... */ - phb->hosts = g_slist_remove(phb->hosts, phb->hosts->data); + connect_info->hosts = g_slist_remove(connect_info->hosts, connect_info->hosts->data); /* Free the address... */ - g_free(phb->hosts->data); - phb->hosts = g_slist_remove(phb->hosts, phb->hosts->data); + g_free(connect_info->hosts->data); + connect_info->hosts = g_slist_remove(connect_info->hosts, connect_info->hosts->data); } - g_free(phb->host); - g_free(phb->write_buffer); - g_free(phb->read_buffer); - g_free(phb); + g_free(connect_info->host); + g_free(connect_info->write_buffer); + g_free(connect_info->read_buffer); + g_free(connect_info); } static void -gaim_proxy_phb_connected(struct _GaimProxyConnectInfo *phb, int fd) +gaim_proxy_connect_info_connected(GaimProxyConnectInfo *connect_info, int fd) { - phb->connect_cb(phb->data, fd); - gaim_proxy_phb_destroy(phb); + connect_info->connect_cb(connect_info->data, fd); + gaim_proxy_connect_info_destroy(connect_info); } /** @@ -292,10 +297,14 @@ * failed. This will be passed to the callback function * specified in the call to gaim_proxy_connect(). */ +/* + * TODO: Make sure all callers of this function pass a really really + * good error_message. + */ static void -gaim_proxy_phb_error(struct _GaimProxyConnectInfo *phb, const gchar *error_message) +gaim_proxy_connect_info_error(GaimProxyConnectInfo *connect_info, const gchar *error_message) { - if (phb->error_cb == NULL) + if (connect_info->error_cb == NULL) { /* * TODO @@ -305,13 +314,13 @@ * an fd of -1 in the case of an error. Once all callers have * been changed this whole if statement should be removed. */ - phb->connect_cb(phb->data, -1); - gaim_proxy_phb_destroy(phb); + connect_info->connect_cb(connect_info->data, -1); + gaim_proxy_connect_info_destroy(connect_info); return; } - phb->error_cb(phb->data, error_message); - gaim_proxy_phb_destroy(phb); + connect_info->error_cb(connect_info->data, error_message); + gaim_proxy_connect_info_destroy(connect_info); } #if defined(__unix__) || defined(__APPLE__) @@ -991,7 +1000,7 @@ static void no_one_calls(gpointer data, gint source, GaimInputCondition cond) { - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; socklen_t len; int error=0, ret; @@ -1017,39 +1026,39 @@ if (ret!=0) error = errno; close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; gaim_debug_error("proxy", "getsockopt SO_ERROR check: %s\n", strerror(error)); - try_connect(phb); + try_connect(connect_info); return; } - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; - gaim_proxy_phb_connected(phb, source); + gaim_proxy_connect_info_connected(connect_info, source); } static gboolean clean_connect(gpointer data) { - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; - gaim_proxy_phb_connected(phb, phb->port); + gaim_proxy_connect_info_connected(connect_info, connect_info->port); return FALSE; } static int -proxy_connect_none(struct _GaimProxyConnectInfo *phb, struct sockaddr *addr, socklen_t addrlen) +proxy_connect_none(GaimProxyConnectInfo *connect_info, struct sockaddr *addr, socklen_t addrlen) { int fd = -1; gaim_debug_info("proxy", - "Connecting to %s:%d with no proxy\n", phb->host, phb->port); + "Connecting to %s:%d with no proxy\n", connect_info->host, connect_info->port); if ((fd = socket(addr->sa_family, SOCK_STREAM, 0)) < 0) { gaim_debug_error("proxy", @@ -1061,12 +1070,13 @@ fcntl(fd, F_SETFD, FD_CLOEXEC); #endif - if (connect(fd, (struct sockaddr *)addr, addrlen) < 0) { + if (connect(fd, (struct sockaddr *)addr, addrlen) != 0) + { if ((errno == EINPROGRESS) || (errno == EINTR)) { /* This just confuses people. */ /* gaim_debug_warning("proxy", "Connect would have blocked.\n"); */ - phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb); + connect_info->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, connect_info); } else { gaim_debug_error("proxy", @@ -1080,14 +1090,15 @@ int error = ETIMEDOUT; gaim_debug_misc("proxy", "Connect didn't block.\n"); len = sizeof(error); - if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0) + { gaim_debug_error("proxy", "getsockopt failed.\n"); close(fd); return -1; } /* TODO: Why is the following line so strange? */ - phb->port = fd; /* bleh */ - gaim_timeout_add(10, clean_connect, phb); /* we do this because we never + connect_info->port = fd; /* bleh */ + gaim_timeout_add(10, clean_connect, connect_info); /* we do this because we never want to call our callback before we return. */ } @@ -1098,33 +1109,33 @@ static void proxy_do_write(gpointer data, gint source, GaimInputCondition cond) { - struct _GaimProxyConnectInfo *phb = data; - const guchar *request = phb->write_buffer + phb->written_len; - gsize request_len = phb->write_buf_len - phb->written_len; + GaimProxyConnectInfo *connect_info = data; + const guchar *request = connect_info->write_buffer + connect_info->written_len; + gsize request_len = connect_info->write_buf_len - connect_info->written_len; int ret = write(source, request, request_len); if(ret < 0 && errno == EAGAIN) return; else if(ret < 0) { - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; close(source); - g_free(phb->write_buffer); - phb->write_buffer = NULL; - try_connect(phb); + g_free(connect_info->write_buffer); + connect_info->write_buffer = NULL; + try_connect(connect_info); return; } else if (ret < request_len) { - phb->written_len += ret; + connect_info->written_len += ret; return; } - gaim_input_remove(phb->inpa); - g_free(phb->write_buffer); - phb->write_buffer = NULL; + gaim_input_remove(connect_info->inpa); + g_free(connect_info->write_buffer); + connect_info->write_buffer = NULL; /* register the response handler for the response */ - phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, phb->read_cb, phb); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_READ, connect_info->read_cb, connect_info); } #define HTTP_GOODSTRING "HTTP/1.0 200" @@ -1136,45 +1147,45 @@ { int len, headers_len, status = 0; gboolean error; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; guchar *p; gsize max_read; gchar *msg; - if(phb->read_buffer == NULL) { - phb->read_buf_len = 8192; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if(connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 8192; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } - p = phb->read_buffer + phb->read_len; - max_read = phb->read_buf_len - phb->read_len - 1; + p = connect_info->read_buffer + connect_info->read_len; + max_read = connect_info->read_buf_len - connect_info->read_len - 1; len = read(source, p, max_read); if(len < 0 && errno == EAGAIN) return; else if(len <= 0) { close(source); - gaim_proxy_phb_error(phb, _("Lost connection with server for an unknown reason.")); + gaim_proxy_connect_info_error(connect_info, _("Lost connection with server for an unknown reason.")); return; } else { - phb->read_len += len; + connect_info->read_len += len; } p[len] = '\0'; - if((p = (guchar *)g_strstr_len((const gchar *)phb->read_buffer, phb->read_len, "\r\n\r\n"))) { + if((p = (guchar *)g_strstr_len((const gchar *)connect_info->read_buffer, connect_info->read_len, "\r\n\r\n"))) { *p = '\0'; - headers_len = (p - phb->read_buffer) + 4; + headers_len = (p - connect_info->read_buffer) + 4; } else if(len == max_read) headers_len = len; else return; - error = strncmp((const char *)phb->read_buffer, "HTTP/", 5) != 0; + error = strncmp((const char *)connect_info->read_buffer, "HTTP/", 5) != 0; if (!error) { int major; - p = phb->read_buffer + 5; + p = connect_info->read_buffer + 5; major = strtol((const char *)p, (char **)&p, 10); error = (major == 0) || (*p != '.'); if(!error) { @@ -1191,7 +1202,7 @@ } /* Read the contents */ - p = (guchar *)g_strrstr((const gchar *)phb->read_buffer, "Content-Length: "); + p = (guchar *)g_strrstr((const gchar *)connect_info->read_buffer, "Content-Length: "); if (p != NULL) { gchar *tmp; @@ -1206,7 +1217,7 @@ *tmp = '\r'; /* Compensate for what has already been read */ - len -= phb->read_len - headers_len; + len -= connect_info->read_len - headers_len; /* I'm assuming that we're doing this to prevent the server from complaining / breaking since we don't read the whole page */ while(len--) { @@ -1220,8 +1231,8 @@ { close(source); msg = g_strdup_printf("Unable to parse response from HTTP proxy: %s\n", - phb->read_buffer); - gaim_proxy_phb_error(phb, msg); + connect_info->read_buffer); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); return; } @@ -1229,15 +1240,15 @@ { gaim_debug_error("proxy", "Proxy server replied with:\n%s\n", - phb->read_buffer); + connect_info->read_buffer); if(status == 407 /* Proxy Auth */) { gchar *ntlm; - if((ntlm = g_strrstr((const gchar *)phb->read_buffer, "Proxy-Authenticate: NTLM "))) { /* Check for Type-2 */ + if((ntlm = g_strrstr((const gchar *)connect_info->read_buffer, "Proxy-Authenticate: NTLM "))) { /* Check for Type-2 */ gchar *tmp = ntlm; guint8 *nonce; - gchar *domain = (gchar*)gaim_proxy_info_get_username(phb->gpi); + gchar *domain = (gchar*)gaim_proxy_info_get_username(connect_info->gpi); gchar *username; gchar *request; gchar *response; @@ -1246,7 +1257,7 @@ { close(source); msg = g_strdup_printf(_("HTTP proxy connection error %d"), status); - gaim_proxy_phb_error(phb, msg); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); return; } @@ -1257,8 +1268,8 @@ *tmp = '\0'; nonce = gaim_ntlm_parse_type2(ntlm, NULL); response = gaim_ntlm_gen_type3(username, - (gchar*) gaim_proxy_info_get_password(phb->gpi), - (gchar*) gaim_proxy_info_get_host(phb->gpi), + (gchar*) gaim_proxy_info_get_password(connect_info->gpi), + (gchar*) gaim_proxy_info_get_host(connect_info->gpi), domain, nonce, NULL); username--; *username = '\\'; @@ -1267,28 +1278,28 @@ "Host: %s:%d\r\n" "Proxy-Authorization: NTLM %s\r\n" "Proxy-Connection: Keep-Alive\r\n\r\n", - phb->host, phb->port, phb->host, - phb->port, response); + connect_info->host, connect_info->port, connect_info->host, + connect_info->port, response); g_free(response); - gaim_input_remove(phb->inpa); - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - phb->write_buffer = (guchar *)request; - phb->write_buf_len = strlen(request); - phb->written_len = 0; + connect_info->write_buffer = (guchar *)request; + connect_info->write_buf_len = strlen(request); + connect_info->written_len = 0; - phb->read_cb = http_canread; + connect_info->read_cb = http_canread; - phb->inpa = gaim_input_add(source, - GAIM_INPUT_WRITE, proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, + GAIM_INPUT_WRITE, proxy_do_write, connect_info); - proxy_do_write(phb, source, cond); + proxy_do_write(connect_info, source, cond); return; - } else if((ntlm = g_strrstr((const char *)phb->read_buffer, "Proxy-Authenticate: NTLM"))) { /* Empty message */ + } else if((ntlm = g_strrstr((const char *)connect_info->read_buffer, "Proxy-Authenticate: NTLM"))) { /* Empty message */ gchar request[2048]; - gchar *domain = (gchar*) gaim_proxy_info_get_username(phb->gpi); + gchar *domain = (gchar*) gaim_proxy_info_get_username(connect_info->gpi); gchar *username; int request_len; username = strchr(domain, '\\'); @@ -1296,7 +1307,7 @@ { close(source); msg = g_strdup_printf(_("HTTP proxy connection error %d"), status); - gaim_proxy_phb_error(phb, msg); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); return; } @@ -1305,8 +1316,8 @@ request_len = g_snprintf(request, sizeof(request), "CONNECT %s:%d HTTP/1.1\r\n" "Host: %s:%d\r\n", - phb->host, phb->port, - phb->host, phb->port); + connect_info->host, connect_info->port, + connect_info->host, connect_info->port); g_return_if_fail(request_len < sizeof(request)); request_len += g_snprintf(request + request_len, @@ -1314,49 +1325,49 @@ "Proxy-Authorization: NTLM %s\r\n" "Proxy-Connection: Keep-Alive\r\n\r\n", gaim_ntlm_gen_type1( - (gchar*) gaim_proxy_info_get_host(phb->gpi), + (gchar*) gaim_proxy_info_get_host(connect_info->gpi), domain)); *username = '\\'; - gaim_input_remove(phb->inpa); - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - phb->write_buffer = g_memdup(request, request_len); - phb->write_buf_len = request_len; - phb->written_len = 0; + connect_info->write_buffer = g_memdup(request, request_len); + connect_info->write_buf_len = request_len; + connect_info->written_len = 0; - phb->read_cb = http_canread; + connect_info->read_cb = http_canread; - phb->inpa = gaim_input_add(source, - GAIM_INPUT_WRITE, proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, + GAIM_INPUT_WRITE, proxy_do_write, connect_info); - proxy_do_write(phb, source, cond); + proxy_do_write(connect_info, source, cond); return; } else { close(source); msg = g_strdup_printf(_("HTTP proxy connection error %d"), status); - gaim_proxy_phb_error(phb, msg); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); return; } } if(status == 403 /* Forbidden */ ) { - msg = g_strdup_printf(_("Access denied: HTTP proxy server forbids port %d tunnelling."), phb->port); - gaim_proxy_phb_error(phb, msg); + msg = g_strdup_printf(_("Access denied: HTTP proxy server forbids port %d tunnelling."), connect_info->port); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); } else { msg = g_strdup_printf(_("HTTP proxy connection error %d"), status); - gaim_proxy_phb_error(phb, msg); + gaim_proxy_connect_info_error(connect_info, msg); g_free(msg); } } else { - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; gaim_debug_info("proxy", "HTTP proxy connection established\n"); - gaim_proxy_phb_connected(phb, source); + gaim_proxy_connect_info_connected(connect_info, source); return; } } @@ -1368,16 +1379,16 @@ { char request[8192]; int request_len = 0; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; socklen_t len; int error = ETIMEDOUT; gaim_debug_info("http proxy", "Connected.\n"); - if (phb->inpa > 0) + if (connect_info->inpa > 0) { - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; } len = sizeof(error); @@ -1385,22 +1396,22 @@ if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { close(source); - try_connect(phb); + try_connect(connect_info); return; } gaim_debug_info("proxy", "using CONNECT tunnelling for %s:%d\n", - phb->host, phb->port); + connect_info->host, connect_info->port); request_len = g_snprintf(request, sizeof(request), "CONNECT %s:%d HTTP/1.1\r\nHost: %s:%d\r\n", - phb->host, phb->port, phb->host, phb->port); + connect_info->host, connect_info->port, connect_info->host, connect_info->port); - if (gaim_proxy_info_get_username(phb->gpi) != NULL) { + if (gaim_proxy_info_get_username(connect_info->gpi) != NULL) { char *t1, *t2; t1 = g_strdup_printf("%s:%s", - gaim_proxy_info_get_username(phb->gpi), - gaim_proxy_info_get_password(phb->gpi) ? - gaim_proxy_info_get_password(phb->gpi) : ""); + gaim_proxy_info_get_username(connect_info->gpi), + gaim_proxy_info_get_password(connect_info->gpi) ? + gaim_proxy_info_get_password(connect_info->gpi) : ""); t2 = gaim_base64_encode((const guchar *)t1, strlen(t1)); g_free(t1); g_return_if_fail(request_len < sizeof(request)); @@ -1411,35 +1422,35 @@ "Proxy-Authorization: NTLM %s\r\n" "Proxy-Connection: Keep-Alive\r\n", t2, gaim_ntlm_gen_type1( - (gchar*)gaim_proxy_info_get_host(phb->gpi),"")); + (gchar*)gaim_proxy_info_get_host(connect_info->gpi),"")); g_free(t2); } g_return_if_fail(request_len < sizeof(request)); strcpy(request + request_len, "\r\n"); request_len += 2; - phb->write_buffer = g_memdup(request, request_len); - phb->write_buf_len = request_len; - phb->written_len = 0; + connect_info->write_buffer = g_memdup(request, request_len); + connect_info->write_buf_len = request_len; + connect_info->written_len = 0; - phb->read_cb = http_canread; + connect_info->read_cb = http_canread; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, - phb); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, + connect_info); - proxy_do_write(phb, source, cond); + proxy_do_write(connect_info, source, cond); } static int -proxy_connect_http(struct _GaimProxyConnectInfo *phb, struct sockaddr *addr, socklen_t addrlen) +proxy_connect_http(GaimProxyConnectInfo *connect_info, struct sockaddr *addr, socklen_t addrlen) { int fd = -1; gaim_debug_info("http proxy", "Connecting to %s:%d via %s:%d using HTTP\n", - (phb->host ? phb->host : "(null)"), phb->port, - (gaim_proxy_info_get_host(phb->gpi) ? gaim_proxy_info_get_host(phb->gpi) : "(null)"), - gaim_proxy_info_get_port(phb->gpi)); + (connect_info->host ? connect_info->host : "(null)"), connect_info->port, + (gaim_proxy_info_get_host(connect_info->gpi) ? gaim_proxy_info_get_host(connect_info->gpi) : "(null)"), + gaim_proxy_info_get_port(connect_info->gpi)); if ((fd = socket(addr->sa_family, SOCK_STREAM, 0)) < 0) { return -1; @@ -1450,18 +1461,19 @@ fcntl(fd, F_SETFD, FD_CLOEXEC); #endif - if (connect(fd, addr, addrlen) < 0) { + if (connect(fd, addr, addrlen) != 0) + { if ((errno == EINPROGRESS) || (errno == EINTR)) { gaim_debug_warning("http proxy", "Connect would have blocked.\n"); - if (phb->port != 80) { + if (connect_info->port != 80) { /* we need to do CONNECT first */ - phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, - http_canwrite, phb); + connect_info->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, + http_canwrite, connect_info); } else { gaim_debug_info("proxy", "HTTP proxy connection established\n"); - gaim_proxy_phb_connected(phb, fd); + gaim_proxy_connect_info_connected(connect_info, fd); } } else { close(fd); @@ -1476,11 +1488,12 @@ "Connect didn't block.\n"); len = sizeof(error); - if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0) + { close(fd); return -1; } - http_canwrite(phb, fd, GAIM_INPUT_WRITE); + http_canwrite(connect_info, fd, GAIM_INPUT_WRITE); } return fd; @@ -1490,41 +1503,41 @@ static void s4_canread(gpointer data, gint source, GaimInputCondition cond) { - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; guchar *buf; int len, max_read; /* This is really not going to block under normal circumstances, but to * be correct, we deal with the unlikely scenario */ - if (phb->read_buffer == NULL) { - phb->read_buf_len = 12; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if (connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 12; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } - buf = phb->read_buffer + phb->read_len; - max_read = phb->read_buf_len - phb->read_len; + buf = connect_info->read_buffer + connect_info->read_len; + max_read = connect_info->read_buf_len - connect_info->read_len; len = read(source, buf, max_read); - if ((len < 0 && errno == EAGAIN) || (len > 0 && len + phb->read_len < 4)) + if ((len < 0 && errno == EAGAIN) || (len > 0 && len + connect_info->read_len < 4)) return; - else if (len + phb->read_len >= 4) { - if (phb->read_buffer[1] == 90) { - gaim_proxy_phb_connected(phb, source); + else if (len + connect_info->read_len >= 4) { + if (connect_info->read_buffer[1] == 90) { + gaim_proxy_connect_info_connected(connect_info, source); return; } } - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; close(source); - try_connect(phb); + try_connect(connect_info); } static void @@ -1532,16 +1545,16 @@ { unsigned char packet[9]; struct hostent *hp; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; socklen_t len; int error = ETIMEDOUT; gaim_debug_info("socks4 proxy", "Connected.\n"); - if (phb->inpa > 0) + if (connect_info->inpa > 0) { - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; } len = sizeof(error); @@ -1549,7 +1562,7 @@ if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { close(source); - try_connect(phb); + try_connect(connect_info); return; } @@ -1561,43 +1574,43 @@ * with an option, or some detection mechanism - in the * meantime, stick with plain old SOCKS4. */ - if (!(hp = gethostbyname(phb->host))) { + if (!(hp = gethostbyname(connect_info->host))) { close(source); - try_connect(phb); + try_connect(connect_info); return; } packet[0] = 4; packet[1] = 1; - packet[2] = phb->port >> 8; - packet[3] = phb->port & 0xff; + packet[2] = connect_info->port >> 8; + packet[3] = connect_info->port & 0xff; packet[4] = (unsigned char)(hp->h_addr_list[0])[0]; packet[5] = (unsigned char)(hp->h_addr_list[0])[1]; packet[6] = (unsigned char)(hp->h_addr_list[0])[2]; packet[7] = (unsigned char)(hp->h_addr_list[0])[3]; packet[8] = 0; - phb->write_buffer = g_memdup(packet, sizeof(packet)); - phb->write_buf_len = sizeof(packet); - phb->written_len = 0; - phb->read_cb = s4_canread; + connect_info->write_buffer = g_memdup(packet, sizeof(packet)); + connect_info->write_buf_len = sizeof(packet); + connect_info->written_len = 0; + connect_info->read_cb = s4_canread; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, connect_info); - proxy_do_write(phb, source, cond); + proxy_do_write(connect_info, source, cond); } static int -proxy_connect_socks4(struct _GaimProxyConnectInfo *phb, struct sockaddr *addr, socklen_t addrlen) +proxy_connect_socks4(GaimProxyConnectInfo *connect_info, struct sockaddr *addr, socklen_t addrlen) { int fd = -1; gaim_debug_info("socks4 proxy", "Connecting to %s:%d via %s:%d using SOCKS4\n", - phb->host, phb->port, - gaim_proxy_info_get_host(phb->gpi), - gaim_proxy_info_get_port(phb->gpi)); + connect_info->host, connect_info->port, + gaim_proxy_info_get_host(connect_info->gpi), + gaim_proxy_info_get_port(connect_info->gpi)); if ((fd = socket(addr->sa_family, SOCK_STREAM, 0)) < 0) return -1; @@ -1607,11 +1620,12 @@ fcntl(fd, F_SETFD, FD_CLOEXEC); #endif - if (connect(fd, addr, addrlen) < 0) { + if (connect(fd, addr, addrlen) != 0) + { if ((errno == EINPROGRESS) || (errno == EINTR)) { gaim_debug_warning("socks4 proxy", "Connect would have blocked.\n"); - phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s4_canwrite, phb); + connect_info->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s4_canwrite, connect_info); } else { close(fd); @@ -1626,12 +1640,13 @@ len = sizeof(error); - if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0) + { close(fd); return -1; } - s4_canwrite(phb, fd, GAIM_INPUT_WRITE); + s4_canwrite(connect_info, fd, GAIM_INPUT_WRITE); } return fd; @@ -1641,36 +1656,36 @@ s5_canread_again(gpointer data, gint source, GaimInputCondition cond) { guchar *dest, *buf; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; int len; - if (phb->read_buffer == NULL) { - phb->read_buf_len = 512; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if (connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 512; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } - dest = phb->read_buffer + phb->read_len; - buf = phb->read_buffer; + dest = connect_info->read_buffer + connect_info->read_len; + buf = connect_info->read_buffer; gaim_debug_info("socks5 proxy", "Able to read again.\n"); - len = read(source, dest, (phb->read_buf_len - phb->read_len)); + len = read(source, dest, (connect_info->read_buf_len - connect_info->read_len)); if(len < 0 && errno == EAGAIN) return; else if(len <= 0) { gaim_debug_warning("socks5 proxy", "or not...\n"); close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - phb->read_len += len; + connect_info->read_len += len; - if(phb->read_len < 4) + if(connect_info->read_len < 4) return; if ((buf[0] != 0x05) || (buf[1] != 0x00)) { @@ -1679,121 +1694,122 @@ else gaim_debug_error("socks5 proxy", "Bad data.\n"); close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } /* Skip past BND.ADDR */ switch(buf[3]) { case 0x01: /* the address is a version-4 IP address, with a length of 4 octets */ - if(phb->read_len < 4 + 4) + if(connect_info->read_len < 4 + 4) return; buf += 4 + 4; break; case 0x03: /* the address field contains a fully-qualified domain name. The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet. */ - if(phb->read_len < 4 + 1) + if(connect_info->read_len < 4 + 1) return; buf += 4 + 1; - if(phb->read_len < 4 + 1 + buf[0]) + if(connect_info->read_len < 4 + 1 + buf[0]) return; buf += buf[0]; break; case 0x04: /* the address is a version-6 IP address, with a length of 16 octets */ - if(phb->read_len < 4 + 16) + if(connect_info->read_len < 4 + 16) return; buf += 4 + 16; break; } - if(phb->read_len < (buf - phb->read_buffer) + 2) + if(connect_info->read_len < (buf - connect_info->read_buffer) + 2) return; /* Skip past BND.PORT */ buf += 2; - gaim_proxy_phb_connected(phb, source); + gaim_proxy_connect_info_connected(connect_info, source); } static void s5_sendconnect(gpointer data, int source) { - struct _GaimProxyConnectInfo *phb = data; - int hlen = strlen(phb->host); - phb->write_buf_len = 5 + hlen + 2; - phb->write_buffer = g_malloc(phb->write_buf_len); - phb->written_len = 0; + GaimProxyConnectInfo *connect_info = data; + int hlen = strlen(connect_info->host); + connect_info->write_buf_len = 5 + hlen + 2; + connect_info->write_buffer = g_malloc(connect_info->write_buf_len); + connect_info->written_len = 0; - phb->write_buffer[0] = 0x05; - phb->write_buffer[1] = 0x01; /* CONNECT */ - phb->write_buffer[2] = 0x00; /* reserved */ - phb->write_buffer[3] = 0x03; /* address type -- host name */ - phb->write_buffer[4] = hlen; - memcpy(phb->write_buffer + 5, phb->host, hlen); - phb->write_buffer[5 + hlen] = phb->port >> 8; - phb->write_buffer[5 + hlen + 1] = phb->port & 0xff; + connect_info->write_buffer[0] = 0x05; + connect_info->write_buffer[1] = 0x01; /* CONNECT */ + connect_info->write_buffer[2] = 0x00; /* reserved */ + connect_info->write_buffer[3] = 0x03; /* address type -- host name */ + connect_info->write_buffer[4] = hlen; + memcpy(connect_info->write_buffer + 5, connect_info->host, hlen); + connect_info->write_buffer[5 + hlen] = connect_info->port >> 8; + connect_info->write_buffer[5 + hlen + 1] = connect_info->port & 0xff; - phb->read_cb = s5_canread_again; + connect_info->read_cb = s5_canread_again; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, phb); - proxy_do_write(phb, source, GAIM_INPUT_WRITE); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, connect_info); + proxy_do_write(connect_info, source, GAIM_INPUT_WRITE); } static void s5_readauth(gpointer data, gint source, GaimInputCondition cond) { - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; int len; - if (phb->read_buffer == NULL) { - phb->read_buf_len = 2; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if (connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 2; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } gaim_debug_info("socks5 proxy", "Got auth response.\n"); - len = read(source, phb->read_buffer + phb->read_len, - phb->read_buf_len - phb->read_len); + len = read(source, connect_info->read_buffer + connect_info->read_len, + connect_info->read_buf_len - connect_info->read_len); if(len < 0 && errno == EAGAIN) return; else if(len <= 0) { close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - phb->read_len += len; + connect_info->read_len += len; - if (phb->read_len < 2) + if (connect_info->read_len < 2) return; - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; - if ((phb->read_buffer[0] != 0x01) || (phb->read_buffer[1] != 0x00)) { + if ((connect_info->read_buffer[0] != 0x01) || (connect_info->read_buffer[1] != 0x00)) { close(source); - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - g_free(phb->read_buffer); - phb->read_buffer = NULL; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - s5_sendconnect(phb, source); + s5_sendconnect(connect_info, source); } -static void hmacmd5_chap(const unsigned char * challenge, int challen, const char * passwd, unsigned char * response) +static void +hmacmd5_chap(const unsigned char * challenge, int challen, const char * passwd, unsigned char * response) { GaimCipher *cipher; GaimCipherContext *ctx; @@ -1840,45 +1856,45 @@ s5_readchap(gpointer data, gint source, GaimInputCondition cond) { guchar *cmdbuf, *buf; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; int len, navas, currentav; gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Got CHAP response.\n"); - if (phb->read_buffer == NULL) { - phb->read_buf_len = 20; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if (connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 20; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } - len = read(source, phb->read_buffer + phb->read_len, - phb->read_buf_len - phb->read_len); + len = read(source, connect_info->read_buffer + connect_info->read_len, + connect_info->read_buf_len - connect_info->read_len); if(len < 0 && errno == EAGAIN) return; else if(len <= 0) { close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - phb->read_len += len; + connect_info->read_len += len; - if (phb->read_len < 2) + if (connect_info->read_len < 2) return; - cmdbuf = phb->read_buffer; + cmdbuf = connect_info->read_buffer; if (*cmdbuf != 0x01) { close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } cmdbuf++; @@ -1887,21 +1903,21 @@ cmdbuf++; for (currentav = 0; currentav < navas; currentav++) { - if (phb->read_len - (cmdbuf - phb->read_buffer) < 2) + if (connect_info->read_len - (cmdbuf - connect_info->read_buffer) < 2) return; - if (phb->read_len - (cmdbuf - phb->read_buffer) < cmdbuf[1]) + if (connect_info->read_len - (cmdbuf - connect_info->read_buffer) < cmdbuf[1]) return; buf = cmdbuf + 2; switch (cmdbuf[0]) { case 0x00: /* Did auth work? */ if (buf[0] == 0x00) { - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; /* Success */ - s5_sendconnect(phb, source); + s5_sendconnect(connect_info, source); return; } else { /* Failure */ @@ -1909,39 +1925,39 @@ "socks5 CHAP authentication " "failed. Disconnecting..."); close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } break; case 0x03: /* Server wants our credentials */ - phb->write_buf_len = 16 + 4; - phb->write_buffer = g_malloc(phb->write_buf_len); - phb->written_len = 0; + connect_info->write_buf_len = 16 + 4; + connect_info->write_buffer = g_malloc(connect_info->write_buf_len); + connect_info->written_len = 0; hmacmd5_chap(buf, cmdbuf[1], - gaim_proxy_info_get_password(phb->gpi), - phb->write_buffer + 4); - phb->write_buffer[0] = 0x01; - phb->write_buffer[1] = 0x01; - phb->write_buffer[2] = 0x04; - phb->write_buffer[3] = 0x10; + gaim_proxy_info_get_password(connect_info->gpi), + connect_info->write_buffer + 4); + connect_info->write_buffer[0] = 0x01; + connect_info->write_buffer[1] = 0x01; + connect_info->write_buffer[2] = 0x04; + connect_info->write_buffer[3] = 0x10; - gaim_input_remove(phb->inpa); - g_free(phb->read_buffer); - phb->read_buffer = NULL; + gaim_input_remove(connect_info->inpa); + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - phb->read_cb = s5_readchap; + connect_info->read_cb = s5_readchap; - phb->inpa = gaim_input_add(source, - GAIM_INPUT_WRITE, proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, + GAIM_INPUT_WRITE, proxy_do_write, connect_info); - proxy_do_write(phb, source, GAIM_INPUT_WRITE); + proxy_do_write(connect_info, source, GAIM_INPUT_WRITE); break; case 0x11: /* Server wants to select an algorithm */ @@ -1954,11 +1970,11 @@ "of the socks5 CHAP specification. " "Disconnecting..."); close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } break; @@ -1973,113 +1989,113 @@ static void s5_canread(gpointer data, gint source, GaimInputCondition cond) { - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; int len; - if (phb->read_buffer == NULL) { - phb->read_buf_len = 2; - phb->read_buffer = g_malloc(phb->read_buf_len); - phb->read_len = 0; + if (connect_info->read_buffer == NULL) { + connect_info->read_buf_len = 2; + connect_info->read_buffer = g_malloc(connect_info->read_buf_len); + connect_info->read_len = 0; } gaim_debug_info("socks5 proxy", "Able to read.\n"); - len = read(source, phb->read_buffer + phb->read_len, - phb->read_buf_len - phb->read_len); + len = read(source, connect_info->read_buffer + connect_info->read_len, + connect_info->read_buf_len - connect_info->read_len); if(len < 0 && errno == EAGAIN) return; else if(len <= 0) { close(source); - gaim_input_remove(phb->inpa); - phb->inpa = 0; - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - phb->read_len += len; + connect_info->read_len += len; - if (phb->read_len < 2) + if (connect_info->read_len < 2) return; - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; - if ((phb->read_buffer[0] != 0x05) || (phb->read_buffer[1] == 0xff)) { + if ((connect_info->read_buffer[0] != 0x05) || (connect_info->read_buffer[1] == 0xff)) { close(source); - g_free(phb->read_buffer); - phb->read_buffer = NULL; - try_connect(phb); + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; + try_connect(connect_info); return; } - if (phb->read_buffer[1] == 0x02) { + if (connect_info->read_buffer[1] == 0x02) { gsize i, j; const char *u, *p; - u = gaim_proxy_info_get_username(phb->gpi); - p = gaim_proxy_info_get_password(phb->gpi); + u = gaim_proxy_info_get_username(connect_info->gpi); + p = gaim_proxy_info_get_password(connect_info->gpi); i = (u == NULL) ? 0 : strlen(u); j = (p == NULL) ? 0 : strlen(p); - phb->write_buf_len = 1 + 1 + i + 1 + j; - phb->write_buffer = g_malloc(phb->write_buf_len); - phb->written_len = 0; + connect_info->write_buf_len = 1 + 1 + i + 1 + j; + connect_info->write_buffer = g_malloc(connect_info->write_buf_len); + connect_info->written_len = 0; - phb->write_buffer[0] = 0x01; /* version 1 */ - phb->write_buffer[1] = i; + connect_info->write_buffer[0] = 0x01; /* version 1 */ + connect_info->write_buffer[1] = i; if (u != NULL) - memcpy(phb->write_buffer + 2, u, i); - phb->write_buffer[2 + i] = j; + memcpy(connect_info->write_buffer + 2, u, i); + connect_info->write_buffer[2 + i] = j; if (p != NULL) - memcpy(phb->write_buffer + 2 + i + 1, p, j); + memcpy(connect_info->write_buffer + 2 + i + 1, p, j); - g_free(phb->read_buffer); - phb->read_buffer = NULL; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - phb->read_cb = s5_readauth; + connect_info->read_cb = s5_readauth; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, - proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, + proxy_do_write, connect_info); - proxy_do_write(phb, source, GAIM_INPUT_WRITE); + proxy_do_write(connect_info, source, GAIM_INPUT_WRITE); return; - } else if (phb->read_buffer[1] == 0x03) { + } else if (connect_info->read_buffer[1] == 0x03) { gsize userlen; - userlen = strlen(gaim_proxy_info_get_username(phb->gpi)); + userlen = strlen(gaim_proxy_info_get_username(connect_info->gpi)); - phb->write_buf_len = 7 + userlen; - phb->write_buffer = g_malloc(phb->write_buf_len); - phb->written_len = 0; + connect_info->write_buf_len = 7 + userlen; + connect_info->write_buffer = g_malloc(connect_info->write_buf_len); + connect_info->written_len = 0; - phb->write_buffer[0] = 0x01; - phb->write_buffer[1] = 0x02; - phb->write_buffer[2] = 0x11; - phb->write_buffer[3] = 0x01; - phb->write_buffer[4] = 0x85; - phb->write_buffer[5] = 0x02; - phb->write_buffer[6] = userlen; - memcpy(phb->write_buffer + 7, - gaim_proxy_info_get_username(phb->gpi), userlen); + connect_info->write_buffer[0] = 0x01; + connect_info->write_buffer[1] = 0x02; + connect_info->write_buffer[2] = 0x11; + connect_info->write_buffer[3] = 0x01; + connect_info->write_buffer[4] = 0x85; + connect_info->write_buffer[5] = 0x02; + connect_info->write_buffer[6] = userlen; + memcpy(connect_info->write_buffer + 7, + gaim_proxy_info_get_username(connect_info->gpi), userlen); - g_free(phb->read_buffer); - phb->read_buffer = NULL; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - phb->read_cb = s5_readchap; + connect_info->read_cb = s5_readchap; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, - proxy_do_write, phb); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, + proxy_do_write, connect_info); - proxy_do_write(phb, source, GAIM_INPUT_WRITE); + proxy_do_write(connect_info, source, GAIM_INPUT_WRITE); return; } else { - g_free(phb->read_buffer); - phb->read_buffer = NULL; + g_free(connect_info->read_buffer); + connect_info->read_buffer = NULL; - s5_sendconnect(phb, source); + s5_sendconnect(connect_info, source); } } @@ -2088,30 +2104,30 @@ { unsigned char buf[5]; int i; - struct _GaimProxyConnectInfo *phb = data; + GaimProxyConnectInfo *connect_info = data; socklen_t len; int error = ETIMEDOUT; gaim_debug_info("socks5 proxy", "Connected.\n"); - if (phb->inpa > 0) + if (connect_info->inpa > 0) { - gaim_input_remove(phb->inpa); - phb->inpa = 0; + gaim_input_remove(connect_info->inpa); + connect_info->inpa = 0; } len = sizeof(error); if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { close(source); - try_connect(phb); + try_connect(connect_info); return; } i = 0; buf[0] = 0x05; /* SOCKS version 5 */ - if (gaim_proxy_info_get_username(phb->gpi) != NULL) { + if (gaim_proxy_info_get_username(connect_info->gpi) != NULL) { buf[1] = 0x03; /* three methods */ buf[2] = 0x00; /* no authentication */ buf[3] = 0x03; /* CHAP authentication */ @@ -2124,26 +2140,26 @@ i = 3; } - phb->write_buf_len = i; - phb->write_buffer = g_malloc(phb->write_buf_len); - memcpy(phb->write_buffer, buf, i); + connect_info->write_buf_len = i; + connect_info->write_buffer = g_malloc(connect_info->write_buf_len); + memcpy(connect_info->write_buffer, buf, i); - phb->read_cb = s5_canread; + connect_info->read_cb = s5_canread; - phb->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, phb); - proxy_do_write(phb, source, GAIM_INPUT_WRITE); + connect_info->inpa = gaim_input_add(source, GAIM_INPUT_WRITE, proxy_do_write, connect_info); + proxy_do_write(connect_info, source, GAIM_INPUT_WRITE); } static int -proxy_connect_socks5(struct _GaimProxyConnectInfo *phb, struct sockaddr *addr, socklen_t addrlen) +proxy_connect_socks5(GaimProxyConnectInfo *connect_info, struct sockaddr *addr, socklen_t addrlen) { int fd = -1; gaim_debug_info("socks5 proxy", "Connecting to %s:%d via %s:%d using SOCKS5\n", - phb->host, phb->port, - gaim_proxy_info_get_host(phb->gpi), - gaim_proxy_info_get_port(phb->gpi)); + connect_info->host, connect_info->port, + gaim_proxy_info_get_host(connect_info->gpi), + gaim_proxy_info_get_port(connect_info->gpi)); if ((fd = socket(addr->sa_family, SOCK_STREAM, 0)) < 0) return -1; @@ -2153,12 +2169,13 @@ fcntl(fd, F_SETFD, FD_CLOEXEC); #endif - if (connect(fd, addr, addrlen) < 0) { + if (connect(fd, addr, addrlen) != 0) + { if ((errno == EINPROGRESS) || (errno == EINTR)) { gaim_debug_warning("socks5 proxy", "Connect would have blocked.\n"); - phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s5_canwrite, phb); + connect_info->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s5_canwrite, connect_info); } else { close(fd); @@ -2169,53 +2186,60 @@ socklen_t len; int error = ETIMEDOUT; - gaim_debug_misc("socks5 proxy", - "Connect didn't block.\n"); + gaim_debug_misc("socks5 proxy", "Connect didn't block.\n"); len = sizeof(error); - if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) != 0) + { close(fd); return -1; } - s5_canwrite(phb, fd, GAIM_INPUT_WRITE); + s5_canwrite(connect_info, fd, GAIM_INPUT_WRITE); } return fd; } -static void try_connect(struct _GaimProxyConnectInfo *phb) +static void try_connect(GaimProxyConnectInfo *connect_info) { size_t addrlen; struct sockaddr *addr; int ret = -1; - while (phb->hosts) { - addrlen = GPOINTER_TO_INT(phb->hosts->data); - phb->hosts = g_slist_remove(phb->hosts, phb->hosts->data); - addr = phb->hosts->data; - phb->hosts = g_slist_remove(phb->hosts, phb->hosts->data); + if (connect_info->hosts == NULL) + { + gaim_proxy_connect_info_error(connect_info, _("Could not resolve host name")); + return; + } - switch (gaim_proxy_info_get_type(phb->gpi)) { + while (connect_info->hosts) + { + addrlen = GPOINTER_TO_INT(connect_info->hosts->data); + connect_info->hosts = g_slist_remove(connect_info->hosts, connect_info->hosts->data); + addr = connect_info->hosts->data; + connect_info->hosts = g_slist_remove(connect_info->hosts, connect_info->hosts->data); + + switch (gaim_proxy_info_get_type(connect_info->gpi)) { case GAIM_PROXY_NONE: - ret = proxy_connect_none(phb, addr, addrlen); + ret = proxy_connect_none(connect_info, addr, addrlen); break; case GAIM_PROXY_HTTP: - ret = proxy_connect_http(phb, addr, addrlen); + ret = proxy_connect_http(connect_info, addr, addrlen); break; case GAIM_PROXY_SOCKS4: - ret = proxy_connect_socks4(phb, addr, addrlen); + ret = proxy_connect_socks4(connect_info, addr, addrlen); break; case GAIM_PROXY_SOCKS5: - ret = proxy_connect_socks5(phb, addr, addrlen); + ret = proxy_connect_socks5(connect_info, addr, addrlen); break; case GAIM_PROXY_USE_ENVVAR: - ret = proxy_connect_http(phb, addr, addrlen); + ret = proxy_connect_http(connect_info, addr, addrlen); break; default: @@ -2224,12 +2248,12 @@ g_free(addr); - if (ret > 0) + if (ret >= 0) break; } if (ret < 0) { - gaim_proxy_phb_error(phb, _("TODO")); + gaim_proxy_connect_info_error(connect_info, _("Unable to establish a connection")); } } @@ -2237,11 +2261,18 @@ connection_host_resolved(GSList *hosts, gpointer data, const char *error_message) { - struct _GaimProxyConnectInfo *phb = (struct _GaimProxyConnectInfo*)data; + GaimProxyConnectInfo *connect_info; - phb->hosts = hosts; + if (error_message != NULL) + { + gaim_debug_info("proxy", "Error while resolving hostname: %s\n", error_message); + /* TODO: Destroy connect_info and return? */ + } - try_connect(phb); + connect_info = data; + connect_info->hosts = hosts; + + try_connect(connect_info); } GaimProxyInfo * @@ -2317,31 +2348,31 @@ { const char *connecthost = host; int connectport = port; - struct _GaimProxyConnectInfo *phb; + GaimProxyConnectInfo *connect_info; g_return_val_if_fail(host != NULL, NULL); g_return_val_if_fail(port > 0, NULL); g_return_val_if_fail(connect_cb != NULL, NULL); /* g_return_val_if_fail(error_cb != NULL, NULL); *//* TODO: Soon! */ - phb = g_new0(struct _GaimProxyConnectInfo, 1); - phb->connect_cb = connect_cb; - phb->error_cb = error_cb; - phb->data = data; - phb->host = g_strdup(host); - phb->port = port; - phb->gpi = gaim_proxy_get_setup(account); + connect_info = g_new0(GaimProxyConnectInfo, 1); + connect_info->connect_cb = connect_cb; + connect_info->error_cb = error_cb; + connect_info->data = data; + connect_info->host = g_strdup(host); + connect_info->port = port; + connect_info->gpi = gaim_proxy_get_setup(account); - if ((gaim_proxy_info_get_type(phb->gpi) != GAIM_PROXY_NONE) && - (gaim_proxy_info_get_host(phb->gpi) == NULL || - gaim_proxy_info_get_port(phb->gpi) <= 0)) { + if ((gaim_proxy_info_get_type(connect_info->gpi) != GAIM_PROXY_NONE) && + (gaim_proxy_info_get_host(connect_info->gpi) == NULL || + gaim_proxy_info_get_port(connect_info->gpi) <= 0)) { gaim_notify_error(NULL, NULL, _("Invalid proxy settings"), _("Either the host name or port number specified for your given proxy type is invalid.")); - gaim_proxy_phb_destroy(phb); + gaim_proxy_connect_info_destroy(connect_info); return NULL; } - switch (gaim_proxy_info_get_type(phb->gpi)) + switch (gaim_proxy_info_get_type(connect_info->gpi)) { case GAIM_PROXY_NONE: break; @@ -2350,25 +2381,25 @@ case GAIM_PROXY_SOCKS4: case GAIM_PROXY_SOCKS5: case GAIM_PROXY_USE_ENVVAR: - connecthost = gaim_proxy_info_get_host(phb->gpi); - connectport = gaim_proxy_info_get_port(phb->gpi); + connecthost = gaim_proxy_info_get_host(connect_info->gpi); + connectport = gaim_proxy_info_get_port(connect_info->gpi); break; default: - gaim_proxy_phb_destroy(phb); + gaim_proxy_connect_info_destroy(connect_info); return NULL; } if (gaim_gethostbyname_async(connecthost, - connectport, connection_host_resolved, phb) != 0) + connectport, connection_host_resolved, connect_info) != 0) { - gaim_proxy_phb_destroy(phb); + gaim_proxy_connect_info_destroy(connect_info); return NULL; } - phbs = g_slist_prepend(phbs, phb); + connect_infos = g_slist_prepend(connect_infos, connect_info); - return phb; + return connect_info; } /* @@ -2379,31 +2410,31 @@ GaimProxyConnectFunction connect_cb, GaimProxyErrorFunction error_cb, gpointer data) { - struct _GaimProxyConnectInfo *phb; + GaimProxyConnectInfo *connect_info; g_return_val_if_fail(host != NULL, NULL); g_return_val_if_fail(port > 0, NULL); g_return_val_if_fail(connect_cb != NULL, NULL); /* g_return_val_if_fail(error_cb != NULL, NULL); *//* TODO: Soon! */ - phb = g_new0(struct _GaimProxyConnectInfo, 1); - phb->connect_cb = connect_cb; - phb->error_cb = error_cb; - phb->data = data; - phb->host = g_strdup(host); - phb->port = port; - phb->gpi = gpi; + connect_info = g_new0(GaimProxyConnectInfo, 1); + connect_info->connect_cb = connect_cb; + connect_info->error_cb = error_cb; + connect_info->data = data; + connect_info->host = g_strdup(host); + connect_info->port = port; + connect_info->gpi = gpi; if (gaim_gethostbyname_async(gaim_proxy_info_get_host(gpi), - gaim_proxy_info_get_port(gpi), connection_host_resolved, phb) != 0) + gaim_proxy_info_get_port(gpi), connection_host_resolved, connect_info) != 0) { - gaim_proxy_phb_destroy(phb); + gaim_proxy_connect_info_destroy(connect_info); return NULL; } - phbs = g_slist_prepend(phbs, phb); + connect_infos = g_slist_prepend(connect_infos, connect_info); - return phb; + return connect_info; } @@ -2486,6 +2517,6 @@ void gaim_proxy_uninit(void) { - while (phbs != NULL) - gaim_proxy_phb_destroy(phbs->data); + while (connect_infos != NULL) + gaim_proxy_connect_info_destroy(connect_infos->data); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-08-14 21:48:15
|
Revision: 16760 Author: eblanton Date: 2006-08-14 14:48:08 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16760&view=rev Log Message: ----------- Merge of 16759: This initializes threads for glib and dbus, because under some circumstances multithreaded libraries are causing dbus badness (namely, gnome-vfs). This fix doesn't really belong in Gaim, but in the interest of expedience (we don't want to wait for upstream libraries to get their initializations all worked around to make things safe) the fix goes here. Note that all Gaim frontends will have to initialize glib threads if other threaded libraries which interact with glib or dbus or what-have-you come into play. Modified Paths: -------------- branches/v2_0_0/configure.ac branches/v2_0_0/src/Makefile.am branches/v2_0_0/src/dbus-server.c branches/v2_0_0/src/gtkmain.c Modified: branches/v2_0_0/configure.ac =================================================================== --- branches/v2_0_0/configure.ac 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/configure.ac 2006-08-14 21:48:08 UTC (rev 16760) @@ -632,7 +632,7 @@ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([ *** GLib 2.0 is required to build Gaim; please make sure you have the GLib *** development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org/.])) +*** always available at http://www.gtk.org/.]),gthread) AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([ *** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+ *** development headers installed. The latest version of GTK+ is Modified: branches/v2_0_0/src/Makefile.am =================================================================== --- branches/v2_0_0/src/Makefile.am 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/Makefile.am 2006-08-14 21:48:08 UTC (rev 16760) @@ -339,6 +339,7 @@ gaim_LDFLAGS = -export-dynamic gaim_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(GTK_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ Modified: branches/v2_0_0/src/dbus-server.c =================================================================== --- branches/v2_0_0/src/dbus-server.c 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/dbus-server.c 2006-08-14 21:48:08 UTC (rev 16760) @@ -757,6 +757,9 @@ void gaim_dbus_init(void) { + if (g_thread_supported()) + dbus_g_thread_init(); + gaim_dbus_init_ids(); g_free(init_error); Modified: branches/v2_0_0/src/gtkmain.c =================================================================== --- branches/v2_0_0/src/gtkmain.c 2006-08-14 21:46:17 UTC (rev 16759) +++ branches/v2_0_0/src/gtkmain.c 2006-08-14 21:48:08 UTC (rev 16760) @@ -643,6 +643,15 @@ gtk_rc_add_default_file(search_path); g_free(search_path); +#if (defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)) + /* Since threads can be yanked in all unawares by other libraries, + * and some libraries aren't smart enough to initialize the thread + * subsystem when they need it, we need to do this here. We also + * threadify dbus when that gets initialized. Ugh. */ + if (!g_thread_supported()) + g_thread_init(NULL); + gdk_threads_init(); +#endif /* Glib has threads */ gui_check = gtk_init_check(&argc, &argv); if (!gui_check) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-18 06:18:50
|
Revision: 16831 Author: thekingant Date: 2006-08-17 23:18:38 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16831&view=rev Log Message: ----------- Backport SVN revisions 16815-16830 from HEAD to v2_0_0, excluding 16818 and 16827 (they were conflicting--I'll get to them in a minute). Original commit messages: 16815: If g_open isn't a macro, we need to specify the mode variable 16816: I will apologize in advance for this ugliness - it is necessary because we have a "connect" macro to cause the wgaim_connect() wrapper function to be used. 16817: nosnilmot pointed out that I'm an idiot and this is a far less ugly way to achieve the same goal. (I swear I tried it first, but must have not actually saved the file when I tested it). 16819: Patch to eggtrayicon by Dan Winship makes icon transparent 16820: Fix CID 250 (also change the behavior to be slightly more sane) and 213 (which wouldn't happen unless the sasl library returned some weird values) 16821: Patch #1523103 ("Improved markup processing"): "This patch tries to handle all the html-entities (including stuff like ® and &#xx;) in gaim_markup_strip_html and gaim_unescape_html. This also allows fixing the issue with libxml2 where & was being converted to &." 16822: Patch #1541742 ("Add boolean property \"iconsel\" for Statusbox"): "This adds a boolean property "iconsel" for statusbox. Setting the property to TRUE shows the icon-selector, setting it to FALSE removes it. It would allow plugins like mystatusbox to better control the statusboxes, especially the per-account ones." 16823: Patch #1541744 ("Memleak"): "This plugs a possible memleak." The memleak would happen if you switch from an account with account-options to an account with none. 16824: This is better. 16825: deryni noticed a missing ')' (it turns out I had SASL disabled) 16826: Fix asserts at startup. 16828: Get rid of an assertion failure when the selected icon is not a valid image 16829: Just rename connect to connectfunc. This is what it was like before my changes. Now I know why! 16830: Patch from Henning Nor?\195?\169n to not show ICQ users as "pending" when they are away without a message Modified Paths: -------------- branches/v2_0_0/COPYRIGHT branches/v2_0_0/ChangeLog branches/v2_0_0/plugins/docklet/eggtrayicon.c branches/v2_0_0/src/gtkaccount.c branches/v2_0_0/src/gtkstatusbox.c branches/v2_0_0/src/protocols/jabber/auth.c branches/v2_0_0/src/protocols/oscar/oscar.c branches/v2_0_0/src/protocols/silc/util.c branches/v2_0_0/src/sslconn.c branches/v2_0_0/src/sslconn.h branches/v2_0_0/src/util.c branches/v2_0_0/src/xmlnode.c Modified: branches/v2_0_0/COPYRIGHT =================================================================== --- branches/v2_0_0/COPYRIGHT 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/COPYRIGHT 2006-08-18 06:18:38 UTC (rev 16831) @@ -316,6 +316,7 @@ Dan Willemsen Jason Willis Matt Wilson +Dan Winship Scott Wolchok Pui Lam Wong Justin Wood Modified: branches/v2_0_0/ChangeLog =================================================================== --- branches/v2_0_0/ChangeLog 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/ChangeLog 2006-08-18 06:18:38 UTC (rev 16831) @@ -99,6 +99,7 @@ removed. * 'Highlight when nick said' option added to Message Notification plugin. + * The system tray icon is now transparent (Dan Winship) MSN Features: * Custom smiley receiving support (Irving Cordova & Francesco Fracassi) Modified: branches/v2_0_0/plugins/docklet/eggtrayicon.c =================================================================== --- branches/v2_0_0/plugins/docklet/eggtrayicon.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/plugins/docklet/eggtrayicon.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -54,6 +54,9 @@ static void egg_tray_icon_realize (GtkWidget *widget); static void egg_tray_icon_unrealize (GtkWidget *widget); +static void egg_tray_icon_add (GtkContainer *container, + GtkWidget *widget); + static void egg_tray_icon_update_manager_window (EggTrayIcon *icon, gboolean dock_if_realized); static void egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon); @@ -109,6 +112,7 @@ { GObjectClass *gobject_class = (GObjectClass *)klass; GtkWidgetClass *widget_class = (GtkWidgetClass *)klass; + GtkContainerClass *container_class = (GtkContainerClass *)klass; parent_class = g_type_class_peek_parent (klass); @@ -117,6 +121,8 @@ widget_class->realize = egg_tray_icon_realize; widget_class->unrealize = egg_tray_icon_unrealize; + container_class->add = egg_tray_icon_add; + g_object_class_install_property (gobject_class, PROP_ORIENTATION, g_param_spec_enum ("orientation", @@ -374,7 +380,37 @@ egg_tray_icon_update_manager_window (icon, TRUE); } +static gboolean +transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) +{ + gdk_window_clear_area (widget->window, event->area.x, event->area.y, + event->area.width, event->area.height); + return FALSE; +} + static void +make_transparent_again (GtkWidget *widget, GtkStyle *previous_style, + gpointer user_data) +{ + gdk_window_set_back_pixmap(widget->window, NULL, TRUE); +} + +static void +make_transparent (GtkWidget *widget, gpointer user_data) +{ + if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget)) + return; + + gtk_widget_set_app_paintable (widget, TRUE); + gtk_widget_set_double_buffered (widget, FALSE); + gdk_window_set_back_pixmap (widget->window, NULL, TRUE); + g_signal_connect (widget, "expose_event", + G_CALLBACK (transparent_expose_event), NULL); + g_signal_connect_after (widget, "style_set", + G_CALLBACK (make_transparent_again), NULL); +} + +static void egg_tray_icon_realize (GtkWidget *widget) { EggTrayIcon *icon = EGG_TRAY_ICON (widget); @@ -386,6 +422,8 @@ if (GTK_WIDGET_CLASS (parent_class)->realize) GTK_WIDGET_CLASS (parent_class)->realize (widget); + make_transparent (widget, NULL); + #if GTK_CHECK_VERSION(2,1,0) screen = gdk_screen_get_number (gtk_widget_get_screen (widget)); xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)); @@ -425,6 +463,14 @@ egg_tray_icon_manager_filter, icon); } +static void +egg_tray_icon_add (GtkContainer *container, GtkWidget *widget) +{ + g_signal_connect (widget, "realize", + G_CALLBACK (make_transparent), NULL); + GTK_CONTAINER_CLASS (parent_class)->add (container, widget); +} + #if GTK_CHECK_VERSION(2,1,0) EggTrayIcon * egg_tray_icon_new_for_screen (GdkScreen *screen, const char *name) Modified: branches/v2_0_0/src/gtkaccount.c =================================================================== --- branches/v2_0_0/src/gtkaccount.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/gtkaccount.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -646,6 +646,11 @@ dialog->protocol_frame = NULL; } + if (dialog->protocol_opt_entries != NULL) { + g_list_free(dialog->protocol_opt_entries); + dialog->protocol_opt_entries = NULL; + } + if (dialog->prpl_info == NULL || dialog->prpl_info->protocol_options == NULL) { @@ -669,11 +674,6 @@ gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_widget_show(vbox); - if (dialog->protocol_opt_entries != NULL) { - g_list_free(dialog->protocol_opt_entries); - dialog->protocol_opt_entries = NULL; - } - for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next) { option = (GaimAccountOption *)l->data; Modified: branches/v2_0_0/src/gtkstatusbox.c =================================================================== --- branches/v2_0_0/src/gtkstatusbox.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/gtkstatusbox.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -115,7 +115,8 @@ enum { PROP_0, - PROP_ACCOUNT + PROP_ACCOUNT, + PROP_ICON_SEL, }; GtkComboBoxClass *parent_class = NULL; @@ -163,6 +164,9 @@ case PROP_ACCOUNT: g_value_set_pointer(value, statusbox->account); break; + case PROP_ICON_SEL: + g_value_set_boolean(value, statusbox->icon_box != NULL); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, psec); break; @@ -253,6 +257,9 @@ static void setup_icon_box(GtkGaimStatusBox *status_box) { + if (status_box->icon_box != NULL) + return; + if (status_box->account && !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) { @@ -280,12 +287,54 @@ } static void +destroy_icon_box(GtkGaimStatusBox *statusbox) +{ + if (statusbox->icon_box == NULL) + return; + + gtk_widget_destroy(statusbox->icon_box); + gdk_cursor_unref(statusbox->hand_cursor); + gdk_cursor_unref(statusbox->arrow_cursor); + + g_object_unref(G_OBJECT(statusbox->buddy_icon)); + g_object_unref(G_OBJECT(statusbox->buddy_icon_hover)); + + if (statusbox->buddy_icon_sel) + gtk_widget_destroy(statusbox->buddy_icon_sel); + + g_free(statusbox->buddy_icon_path); + + statusbox->icon_box = NULL; + statusbox->buddy_icon_path = NULL; + statusbox->buddy_icon = NULL; + statusbox->buddy_icon_hover = NULL; + statusbox->hand_cursor = NULL; + statusbox->arrow_cursor = NULL; +} + +static void gtk_gaim_status_box_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { GtkGaimStatusBox *statusbox = GTK_GAIM_STATUS_BOX(object); switch (param_id) { + case PROP_ICON_SEL: + if (g_value_get_boolean(value)) { + if (statusbox->account) { + GaimPlugin *plug = gaim_plugins_find_with_id(gaim_account_get_protocol_id(statusbox->account)); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo && prplinfo->icon_spec.format != NULL) + setup_icon_box(statusbox); + } + } else { + setup_icon_box(statusbox); + } + } else { + destroy_icon_box(statusbox); + } + break; case PROP_ACCOUNT: statusbox->account = g_value_get_pointer(value); @@ -296,16 +345,9 @@ } if (statusbox->account) { - GaimPlugin *plug = gaim_plugins_find_with_id(gaim_account_get_protocol_id(statusbox->account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (prplinfo && prplinfo->icon_spec.format != NULL) { - setup_icon_box(statusbox); - } statusbox->status_changed_signal = gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", statusbox, GAIM_CALLBACK(account_status_changed_cb), statusbox); - } else { - setup_icon_box(statusbox); } gtk_gaim_status_box_regenerate(statusbox); @@ -365,6 +407,7 @@ combo_box_forall = container_class->forall; container_class->forall = gtk_gaim_status_box_forall; + container_class->remove = NULL; object_class = (GObjectClass *)klass; @@ -381,6 +424,15 @@ G_PARAM_READWRITE ) ); + g_object_class_install_property(object_class, + PROP_ICON_SEL, + g_param_spec_boolean("iconsel", + "Icon Selector", + "Whether the icon selector should be displayed or not.", + FALSE, + G_PARAM_READWRITE + ) + ); } /** @@ -1001,6 +1053,7 @@ gaim_account_set_buddy_icon(box->account, icon); g_free(icon); gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + gaim_account_set_ui_string(box->account, GAIM_GTK_UI, "non-global-buddyicon", icon); } } } else { @@ -1218,17 +1271,22 @@ if (status_box->icon_size != icon_alc.height) { + if (status_box->buddy_icon_hover) + g_object_unref(status_box->buddy_icon_hover); if ((status_box->buddy_icon_path != NULL) && (*status_box->buddy_icon_path != '\0')) { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); - g_object_unref(status_box->buddy_icon_hover); - status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); - g_object_unref(status_box->buddy_icon); - status_box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); + if (scaled != NULL) + { + status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); + if (status_box->buddy_icon) + g_object_unref(status_box->buddy_icon); + status_box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); + } } status_box->icon_size = icon_alc.height; } @@ -1247,7 +1305,8 @@ GtkGaimStatusBox *status_box = GTK_GAIM_STATUS_BOX(widget); gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->vbox, event); gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event); - gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->icon_box, event); + if (status_box->icon_box) + gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->icon_box, event); return FALSE; } @@ -1274,13 +1333,15 @@ GtkWidget * gtk_gaim_status_box_new() { - return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", NULL, NULL); + return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", NULL, + "iconsel", TRUE, NULL); } GtkWidget * gtk_gaim_status_box_new_with_account(GaimAccount *account) { - return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", account, NULL); + return g_object_new(GTK_GAIM_TYPE_STATUS_BOX, "account", account, + "iconsel", TRUE, NULL); } /** @@ -1384,14 +1445,18 @@ { if (box->buddy_icon != NULL) g_object_unref(box->buddy_icon); - scaled = gdk_pixbuf_new_from_file_at_scale(filename, - box->icon_size, box->icon_size, FALSE, NULL); - if (scaled != NULL) - { - box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); - box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + + /* This will get called before the box is shown and will not have a size */ + if (box->icon_size > 0) { + scaled = gdk_pixbuf_new_from_file_at_scale(filename, + box->icon_size, box->icon_size, FALSE, NULL); + if (scaled != NULL) + { + box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); + box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + } } } Modified: branches/v2_0_0/src/protocols/jabber/auth.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/auth.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/protocols/jabber/auth.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -181,9 +181,9 @@ static void jabber_auth_start_cyrus(JabberStream *js) { - const char *clientout, *mech; + const char *clientout = NULL, *mech = NULL; char *enc_out; - unsigned coutlen; + unsigned coutlen = 0; xmlnode *auth; sasl_security_properties_t secprops; gboolean again; @@ -256,21 +256,29 @@ /* For everything else, fail the mechanism and try again */ default: gaim_debug_info("sasl", "sasl_state is %d, failing the mech and trying again\n", js->sasl_state); - if (strlen(mech)>0) { + + /* + * DAA: is this right? + * The manpage says that "mech" will contain the chosen mechanism on success. + * Presumably, if we get here that isn't the case and we shouldn't try again? + * I suspect that this never happens. + */ + if (mech && strlen(mech) > 0) { char *pos; - pos = strstr(js->sasl_mechs->str,mech); - g_assert(pos!=NULL); - g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str,strlen(mech)); + if ((pos = strstr(js->sasl_mechs->str, mech))) { + g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(mech)); + } + again = TRUE; } + sasl_dispose(&js->sasl); - again=TRUE; } } while (again); if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) { auth = xmlnode_new("auth"); xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); - xmlnode_set_attrib(auth,"mechanism", mech); + xmlnode_set_attrib(auth, "mechanism", mech); if (clientout) { if (coutlen == 0) { xmlnode_insert_data(auth, "=", -1); @@ -332,7 +340,7 @@ char *mech_name = xmlnode_get_data(mechnode); #ifdef HAVE_CYRUS_SASL g_string_append(js->sasl_mechs, mech_name); - g_string_append_c(js->sasl_mechs,' '); + g_string_append_c(js->sasl_mechs, ' '); #else if(mech_name && !strcmp(mech_name, "DIGEST-MD5")) digest_md5 = TRUE; Modified: branches/v2_0_0/src/protocols/oscar/oscar.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/protocols/oscar/oscar.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -2885,6 +2885,9 @@ gaim_status_set_attr_string(status, "message", message); g_free(message); } + else + /* Set an empty message so that we know not to show "pending" */ + gaim_status_set_attr_string(status, "message", message); gaim_blist_update_buddy_status(b, status); } Modified: branches/v2_0_0/src/protocols/silc/util.c =================================================================== --- branches/v2_0_0/src/protocols/silc/util.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/protocols/silc/util.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -234,7 +234,7 @@ } #endif - if ((fd = g_open(file_private_key, O_RDONLY)) != -1) { + if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) { if ((fstat(fd, &st)) == -1) { gaim_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", file_private_key, strerror(errno)); @@ -254,7 +254,7 @@ return FALSE; } - if ((fd = g_open(file_private_key, O_RDONLY)) != -1) { + if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) { if ((fstat(fd, &st)) == -1) { gaim_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", file_private_key, strerror(errno)); Modified: branches/v2_0_0/src/sslconn.c =================================================================== --- branches/v2_0_0/src/sslconn.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/sslconn.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -46,7 +46,7 @@ ops = gaim_ssl_get_ops(); if ((ops == NULL) || (ops->init == NULL) || (ops->uninit == NULL) || - (ops->connect == NULL) || (ops->close == NULL) || + (ops->connectfunc == NULL) || (ops->close == NULL) || (ops->read == NULL) || (ops->write == NULL)) { return FALSE; @@ -87,7 +87,7 @@ gsc->fd = source; ops = gaim_ssl_get_ops(); - ops->connect(gsc); + ops->connectfunc(gsc); } GaimSslConnection * @@ -177,7 +177,7 @@ gsc->fd = fd; ops = gaim_ssl_get_ops(); - ops->connect(gsc); + ops->connectfunc(gsc); return (GaimSslConnection *)gsc; } Modified: branches/v2_0_0/src/sslconn.h =================================================================== --- branches/v2_0_0/src/sslconn.h 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/sslconn.h 2006-08-18 06:18:38 UTC (rev 16831) @@ -68,7 +68,7 @@ { gboolean (*init)(void); void (*uninit)(void); - void (*connect)(GaimSslConnection *gsc); + void (*connectfunc)(GaimSslConnection *gsc); void (*close)(GaimSslConnection *gsc); size_t (*read)(GaimSslConnection *gsc, void *data, size_t len); size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len); Modified: branches/v2_0_0/src/util.c =================================================================== --- branches/v2_0_0/src/util.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/util.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -854,6 +854,55 @@ /************************************************************************** * Markup Functions **************************************************************************/ + +/* Returns a NULL-terminated string after unescaping an entity + * (eg. &, < & etc.) starting at s. Returns NULL on failure.*/ +static const char * +detect_entity(const char *text, int *length) +{ + const char *pln; + int len, pound; + + if (!text || *text != '&') + return NULL; + +#define IS_ENTITY(s) (!g_ascii_strncasecmp(text, s, (len = sizeof(s) - 1))) + + if(IS_ENTITY("&")) + pln = "&"; + else if(IS_ENTITY("<")) + pln = "<"; + else if(IS_ENTITY(">")) + pln = ">"; + else if(IS_ENTITY(" ")) + pln = " "; + else if(IS_ENTITY("©")) + pln = "\302\251"; /* or use g_unichar_to_utf8(0xa9); */ + else if(IS_ENTITY(""")) + pln = "\""; + else if(IS_ENTITY("®")) + pln = "\302\256"; /* or use g_unichar_to_utf8(0xae); */ + else if(IS_ENTITY("'")) + pln = "\'"; + else if(*(text+1) == '#' && (sscanf(text, "&#%u;", £) == 1) && + pound != 0 && *(text+3+(gint)log10(pound)) == ';') { + static char buf[7]; + int buflen = g_unichar_to_utf8((gunichar)pound, buf); + buf[buflen] = '\0'; + pln = buf; + + len = 2; + while(isdigit((gint) text[len])) len++; + if(text[len] == ';') len++; + } + else + return NULL; + + if (length) + *length = len; + return pln; +} + gboolean gaim_markup_find_tag(const char *needle, const char *haystack, const char **start, const char **end, GData **attributes) @@ -1443,44 +1492,10 @@ } } else if(*c == '&') { char buf[7]; - char *pln; - int len = 1; - guint pound; - if(!g_ascii_strncasecmp(c, "&", 5)) { - pln = "&"; - len = 5; - } else if(!g_ascii_strncasecmp(c, "<", 4)) { - pln = "<"; - len = 4; - } else if(!g_ascii_strncasecmp(c, ">", 4)) { - pln = ">"; - len = 4; - } else if(!g_ascii_strncasecmp(c, " ", 6)) { - pln = " "; - len = 6; - } else if(!g_ascii_strncasecmp(c, "©", 6)) { - pln = "©"; - len = 6; - } else if(!g_ascii_strncasecmp(c, """, 6)) { - pln = "\""; - len = 6; - } else if(!g_ascii_strncasecmp(c, "®", 5)) { - pln = "®"; - len = 5; - } else if(!g_ascii_strncasecmp(c, "'", 6)) { - pln = "\'"; - len = 6; - } else if(*(c+1) == '#' && (sscanf(c, "&#%u;", £) == 1) && - pound != 0 && *(c+3+(gint)log10(pound)) == ';') { - int buflen = g_unichar_to_utf8((gunichar)pound, buf); - buf[buflen] = '\0'; - pln = buf; + const char *pln; + int len; - - len = 2; - while(isdigit((gint) c [len])) len++; - if(c [len] == ';') len++; - } else { + if ((pln = detect_entity(c, &len)) == NULL) { len = 1; g_snprintf(buf, sizeof(buf), "%c", *c); pln = buf; @@ -1522,11 +1537,11 @@ char * gaim_markup_strip_html(const char *str) { - int i, j, k; + int i, j, k, entlen; gboolean visible = TRUE; gboolean closing_td_p = FALSE; gchar *str2; - const gchar *cdata_close_tag = NULL; + const gchar *cdata_close_tag = NULL, *ent; gchar *href = NULL; int href_st = 0; @@ -1685,44 +1700,14 @@ visible = TRUE; } - /* XXX: This sucks. We need to be un-escaping all entities, which - * includes these, as well as the &#num; ones */ - - if (str2[i] == '&' && strncasecmp(str2 + i, """, 6) == 0) + if (str2[i] == '&' && (ent = detect_entity(str2 + i, &entlen)) != NULL) { - str2[j++] = '\"'; - i = i + 5; - continue; - } - - if (str2[i] == '&' && strncasecmp(str2 + i, "&", 5) == 0) - { - str2[j++] = '&'; - i = i + 4; + while (*ent) + str2[j++] = *ent++; + i += entlen - 1; continue; } - if (str2[i] == '&' && strncasecmp(str2 + i, "<", 4) == 0) - { - str2[j++] = '<'; - i = i + 3; - continue; - } - - if (str2[i] == '&' && strncasecmp(str2 + i, ">", 4) == 0) - { - str2[j++] = '>'; - i = i + 3; - continue; - } - - if (str2[i] == '&' && strncasecmp(str2 + i, "'", 6) == 0) - { - str2[j++] = '\''; - i = i + 5; - continue; - } - if (visible) str2[j++] = g_ascii_isspace(str2[i])? ' ': str2[i]; } @@ -2026,41 +2011,28 @@ char * gaim_unescape_html(const char *html) { - const char *c; - GString *ret; + if (html != NULL) { + const char *c = html; + GString *ret = g_string_new(""); + while (*c) { + int len; + const char *ent; - if (html == NULL) - return NULL; - - c = html; - ret = g_string_new(""); - while (*c) { - if (!strncmp(c, "&", 5)) { - ret = g_string_append_c(ret, '&'); - c += 5; - } else if (!strncmp(c, "<", 4)) { - ret = g_string_append_c(ret, '<'); - c += 4; - } else if (!strncmp(c, ">", 4)) { - ret = g_string_append_c(ret, '>'); - c += 4; - } else if (!strncmp(c, """, 6)) { - ret = g_string_append_c(ret, '"'); - c += 6; - } else if (!strncmp(c, "'", 6)) { - ret = g_string_append_c(ret, '\''); - c += 6; - } else if (!strncmp(c, "<br>", 4)) { - ret = g_string_append_c(ret, '\n'); - c += 4; - } else { - ret = g_string_append_c(ret, *c); - c++; + if ((ent = detect_entity(c, &len)) != NULL) { + ret = g_string_append(ret, ent); + c += len; + } else if (!strncmp(c, "<br>", 4)) { + ret = g_string_append_c(ret, '\n'); + c += 4; + } else { + ret = g_string_append_c(ret, *c); + c++; + } } + return g_string_free(ret, FALSE); } - return g_string_free(ret, FALSE); - + return NULL; } char * @@ -3996,4 +3968,3 @@ return buf; } - Modified: branches/v2_0_0/src/xmlnode.c =================================================================== --- branches/v2_0_0/src/xmlnode.c 2006-08-18 05:59:47 UTC (rev 16830) +++ branches/v2_0_0/src/xmlnode.c 2006-08-18 06:18:38 UTC (rev 16831) @@ -35,6 +35,7 @@ #include <string.h> #include <glib.h> +#include "util.h" #include "xmlnode.h" #ifdef _WIN32 @@ -406,6 +407,11 @@ char *attrib = g_malloc(attrib_len + 1); memcpy(attrib, attributes[i+3], attrib_len); attrib[attrib_len] = '\0'; +#ifdef HAVE_LIBXML + char *txt = attrib; + attrib = gaim_unescape_html(txt); + g_free(txt); +#endif xmlnode_set_attrib(node, attributes[i], attrib); g_free(attrib); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |