Mercurial > pidgin.yaz
changeset 29881:0fe3f0bc0695
merged with im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 25 Feb 2010 16:27:25 +0900 |
parents | 8cf8a75875c8 (current diff) 15e26b945a7a (diff) |
children | 08ceb05e9fe9 |
files | libpurple/protocols/irc/irc.c libpurple/protocols/msn/msn.c libpurple/protocols/oscar/oscar.c libpurple/protocols/oscar/oscar.h libpurple/protocols/yahoo/libyahoo.c libpurple/protocols/yahoo/libyahoojp.c pidgin/gtkblist.c |
diffstat | 29 files changed, 296 insertions(+), 233 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Feb 22 17:17:28 2010 +0900 +++ b/ChangeLog Thu Feb 25 16:27:25 2010 +0900 @@ -18,6 +18,9 @@ * Make the search dialog unobtrusive in the conversation window (by making it look and behave like the search dialog in Firefox) + Bonjour: + * Added support for IPv6. (Thanks to T_X for testing) + version 2.6.6 (02/18/2010): libpurple: * Fix 'make check' on OS X. (David Fang)
--- a/libpurple/protocols/bonjour/bonjour.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/bonjour/bonjour.c Thu Feb 25 16:27:25 2010 +0900 @@ -101,6 +101,8 @@ /* Start waiting for jabber connections (iChat style) */ bd->jabber_data = g_new0(BonjourJabber, 1); + bd->jabber_data->socket = -1; + bd->jabber_data->socket6 = -1; bd->jabber_data->port = purple_account_get_int(account, "port", BONJOUR_DEFAULT_PORT); bd->jabber_data->account = account; @@ -525,7 +527,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/bonjour/bonjour_ft.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/bonjour/bonjour_ft.c Thu Feb 25 16:27:25 2010 +0900 @@ -747,8 +747,7 @@ XepIq *iq; xmlnode *query, *streamhost; gchar *port; - const char *next_ip, *local_ip; - const char token [] = ";"; + GSList *local_ips; BonjourData *bd; purple_debug_info("bonjour", "Bonjour-bytestreams-listen. sock=%d.\n", sock); @@ -773,17 +772,16 @@ xfer->local_port = purple_network_get_port_from_fd(sock); - local_ip = purple_network_get_my_ip_ext2(sock); - /* cheat a little here - the intent of the "const" attribute is to make it clear that the string doesn't need to be freed */ - next_ip = strtok((char *)local_ip, token); + local_ips = bonjour_jabber_get_local_ips(sock); port = g_strdup_printf("%hu", xfer->local_port); - while(next_ip != NULL) { + while(local_ips) { streamhost = xmlnode_new_child(query, "streamhost"); xmlnode_set_attrib(streamhost, "jid", xf->sid); - xmlnode_set_attrib(streamhost, "host", next_ip); + xmlnode_set_attrib(streamhost, "host", local_ips->data); xmlnode_set_attrib(streamhost, "port", port); - next_ip = strtok(NULL, token); + g_free(local_ips->data); + local_ips = g_slist_delete_link(local_ips, local_ips); } g_free(port); @@ -796,15 +794,17 @@ XepXfer *xf; if(xfer == NULL) return; + purple_debug_info("bonjour", "Bonjour-bytestreams-init.\n"); xf = xfer->data; + purple_network_listen_map_external(FALSE); xf->listen_data = purple_network_listen_range(0, 0, SOCK_STREAM, bonjour_bytestreams_listen, xfer); purple_network_listen_map_external(TRUE); - if (xf->listen_data == NULL) { + if (xf->listen_data == NULL) purple_xfer_cancel_local(xfer); - } + return; }
--- a/libpurple/protocols/bonjour/jabber.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/bonjour/jabber.c Thu Feb 25 16:27:25 2010 +0900 @@ -44,6 +44,11 @@ #endif #include <fcntl.h> +#ifdef HAVE_GETIFADDRS +#include <ifaddrs.h> +#endif + + #include "network.h" #include "eventloop.h" #include "connection.h" @@ -623,15 +628,22 @@ } +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN 46 +#endif + static void _server_socket_handler(gpointer data, int server_socket, PurpleInputCondition condition) { BonjourJabber *jdata = data; - struct sockaddr_in their_addr; /* connector's address information */ - socklen_t sin_size = sizeof(struct sockaddr); + struct sockaddr_storage their_addr; /* connector's address information */ + socklen_t sin_size = sizeof(struct sockaddr_storage); int client_socket; int flags; - char *address_text = NULL; +#ifdef HAVE_INET_NTOP + char addrstr[INET6_ADDRSTRLEN]; +#endif + const char *address_text; struct _match_buddies_by_address_t *mbba; BonjourJabberConversation *bconv; GSList *buddies; @@ -640,7 +652,9 @@ if (condition != PURPLE_INPUT_READ) return; - if ((client_socket = accept(server_socket, (struct sockaddr *)&their_addr, &sin_size)) == -1) + memset(&their_addr, 0, sin_size); + + if ((client_socket = accept(server_socket, (struct sockaddr*)&their_addr, &sin_size)) == -1) return; flags = fcntl(client_socket, F_GETFL); @@ -650,7 +664,16 @@ #endif /* Look for the buddy that has opened the conversation and fill information */ - address_text = inet_ntoa(their_addr.sin_addr); +#ifdef HAVE_INET_NTOP + if (their_addr.ss_family == AF_INET6) + address_text = inet_ntop(their_addr.ss_family, &((struct sockaddr_in6 *)&their_addr)->sin6_addr, + addrstr, sizeof(addrstr)); + else + address_text = inet_ntop(their_addr.ss_family, &((struct sockaddr_in *)&their_addr)->sin_addr, + addrstr, sizeof(addrstr)); +#else + address_text = inet_ntoa(((struct sockaddr_in *)&their_addr)->sin_addr); +#endif purple_debug_info("bonjour", "Received incoming connection from %s.\n", address_text); mbba = g_new0(struct _match_buddies_by_address_t, 1); mbba->address = address_text; @@ -680,52 +703,42 @@ } -gint -bonjour_jabber_start(BonjourJabber *jdata) +static int +start_serversocket_listening(int port, int socket, struct sockaddr *addr, size_t addr_size, gboolean ip6, gboolean allow_port_fallback) { - struct sockaddr_in my_addr; + int ret_port = port; - /* Open a listening socket for incoming conversations */ - jdata->socket = socket(PF_INET, SOCK_STREAM, 0); - if (jdata->socket < 0) { - gchar *buf = g_strdup_printf(_("Unable to create socket: %s"), - g_strerror(errno)); - purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); - g_free(buf); - return -1; - } - - memset(&my_addr, 0, sizeof(struct sockaddr_in)); - my_addr.sin_family = AF_INET; + purple_debug_info("bonjour", "Attempting to bind IPv%d socket to port %d.\n", ip6 ? 6 : 4, port); /* Try to use the specified port - if it isn't available, use a random port */ - my_addr.sin_port = htons(jdata->port); - if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) - { + if (bind(socket, addr, addr_size) != 0) { + purple_debug_info("bonjour", "Unable to bind to specified " - "port %i: %s\n", jdata->port, g_strerror(errno)); - my_addr.sin_port = 0; - if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) - { - gchar *buf = g_strdup_printf(_("Unable to bind socket " - "to port: %s"), g_strerror(errno)); - purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); - g_free(buf); + "port %i: %s\n", port, g_strerror(errno)); + + if (!allow_port_fallback) { + purple_debug_warning("bonjour", "Not attempting random port assignment.\n"); return -1; } - jdata->port = purple_network_get_port_from_fd(jdata->socket); +#ifdef PF_INET6 + if (ip6) + ((struct sockaddr_in6 *) addr)->sin6_port = 0; + else +#endif + ((struct sockaddr_in *) addr)->sin_port = 0; + + if (bind(socket, addr, addr_size) != 0) { + purple_debug_error("bonjour", "Unable to bind IPv%d socket to port: %s\n", ip6 ? 6 : 4, g_strerror(errno)); + return -1; + } + ret_port = purple_network_get_port_from_fd(socket); } + purple_debug_info("bonjour", "Bound IPv%d socket to port %d.\n", ip6 ? 6 : 4, ret_port); + /* Attempt to listen on the bound socket */ - if (listen(jdata->socket, 10) != 0) - { - gchar *buf = g_strdup_printf(_("Unable to listen on socket: %s"), - g_strerror(errno)); - purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); - g_free(buf); + if (listen(socket, 10) != 0) { + purple_debug_error("bonjour", "Unable to listen on IPv%d socket: %s\n", ip6 ? 6 : 4, g_strerror(errno)); return -1; } @@ -739,8 +752,66 @@ } #endif - /* Open a watcher in the socket we have just opened */ - jdata->watcher_id = purple_input_add(jdata->socket, PURPLE_INPUT_READ, _server_socket_handler, jdata); + return ret_port; +} + +gint +bonjour_jabber_start(BonjourJabber *jdata) +{ + int ipv6_port = -1, ipv4_port = -1; + + /* Open a listening socket for incoming conversations */ +#ifdef PF_INET6 + jdata->socket6 = socket(PF_INET6, SOCK_STREAM, 0); +#endif + jdata->socket = socket(PF_INET, SOCK_STREAM, 0); + if (jdata->socket == -1 && jdata->socket6 == -1) { + purple_debug_error("bonjour", "Unable to create socket: %s", + g_strerror(errno)); + return -1; + } + +#ifdef PF_INET6 + if (jdata->socket6 != -1) { + struct sockaddr_in6 addr6; + memset(&addr6, 0, sizeof(addr6)); + addr6.sin6_family = AF_INET6; + addr6.sin6_port = htons(jdata->port); + addr6.sin6_addr = in6addr_any; + ipv6_port = start_serversocket_listening(jdata->port, jdata->socket6, (struct sockaddr *) &addr6, sizeof(addr6), TRUE, TRUE); + /* Open a watcher in the socket we have just opened */ + if (ipv6_port > 0) { + jdata->watcher_id6 = purple_input_add(jdata->socket6, PURPLE_INPUT_READ, _server_socket_handler, jdata); + jdata->port = ipv6_port; + } else { + purple_debug_error("bonjour", "Failed to start listening on IPv6 socket.\n"); + close(jdata->socket6); + jdata->socket6 = -1; + } + } +#endif + if (jdata->socket != -1) { + struct sockaddr_in addr4; + memset(&addr4, 0, sizeof(addr4)); + addr4.sin_family = AF_INET; + addr4.sin_port = htons(jdata->port); + ipv4_port = start_serversocket_listening(jdata->port, jdata->socket, (struct sockaddr *) &addr4, sizeof(addr4), FALSE, ipv6_port != -1); + /* Open a watcher in the socket we have just opened */ + if (ipv4_port > 0) { + jdata->watcher_id = purple_input_add(jdata->socket, PURPLE_INPUT_READ, _server_socket_handler, jdata); + jdata->port = ipv4_port; + } else { + purple_debug_error("bonjour", "Failed to start listening on IPv4 socket.\n"); + close(jdata->socket); + jdata->socket = -1; + } + } + + if (!(ipv6_port > 0 || ipv4_port > 0)) { + purple_debug_error("bonjour", "Unable to listen on socket: %s", + g_strerror(errno)); + return -1; + } return jdata->port; } @@ -1101,6 +1172,10 @@ close(jdata->socket); if (jdata->watcher_id > 0) purple_input_remove(jdata->watcher_id); + if (jdata->socket6 >= 0) + close(jdata->socket6); + if (jdata->watcher_id6 > 0) + purple_input_remove(jdata->watcher_id6); /* Close all the conversation sockets and remove all the watchers after sending end streams */ if (jdata->account->gc != NULL) { @@ -1234,58 +1309,97 @@ return (ret >= 0) ? 0 : -1; } -/* This returns a ';' delimited string containing all non-localhost IPs */ -const char * -purple_network_get_my_ip_ext2(int fd) +/* This returns a list containing all non-localhost IPs */ +GSList * +bonjour_jabber_get_local_ips(int fd) { - char buffer[1024]; - static char ip_ext[17 * 10]; + GSList *ips = NULL; + const char *address_text; + int ret; + +#ifdef HAVE_GETIFADDRS /* This is required for IPv6 */ + { + struct ifaddrs *ifap, *ifa; + struct sockaddr *addr; + char addrstr[INET6_ADDRSTRLEN]; + + ret = getifaddrs(&ifap); + if (ret != 0) { + const char *error = g_strerror(errno); + purple_debug_error("bonjour", "getifaddrs() error: %s\n", error ? error : "(null)"); + return NULL; + } + + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { + if (!(ifa->ifa_flags & IFF_RUNNING) || (ifa->ifa_flags & IFF_LOOPBACK) || ifa->ifa_addr == NULL) + continue; + + addr = ifa->ifa_addr; + address_text = NULL; + switch (addr->sa_family) { + case AF_INET: + address_text = inet_ntop(addr->sa_family, &((struct sockaddr_in *)addr)->sin_addr, + addrstr, sizeof(addrstr)); + break; +#ifdef PF_INET6 + case AF_INET6: + address_text = inet_ntop(addr->sa_family, &((struct sockaddr_in6 *)addr)->sin6_addr, + addrstr, sizeof(addrstr)); + break; +#endif + } + + if (address_text != NULL) { + if (addr->sa_family == AF_INET) + ips = g_slist_append(ips, g_strdup(address_text)); + else + ips = g_slist_prepend(ips, g_strdup(address_text)); + } + } + + freeifaddrs(ifap); + + } +#else + { char *tmp; - char *tip; struct ifconf ifc; struct ifreq *ifr; + char buffer[1024]; struct sockaddr_in *sinptr; - guint32 lhost = htonl(127 * 256 * 256 * 256 + 1); - long unsigned int add; int source = fd; - int len, count = 0; if (fd < 0) source = socket(PF_INET, SOCK_STREAM, 0); ifc.ifc_len = sizeof(buffer); ifc.ifc_req = (struct ifreq *)buffer; - ioctl(source, SIOCGIFCONF, &ifc); + ret = ioctl(source, SIOCGIFCONF, &ifc); if (fd < 0) close(source); - memset(ip_ext, 0, sizeof(ip_ext)); - memcpy(ip_ext, "0.0.0.0", 7); + if (ret < 0) { + const char *error = g_strerror(errno); + purple_debug_error("bonjour", "ioctl(SIOCGIFCONF) error: %s\n", error ? error : "(null)"); + return NULL; + } + tmp = buffer; - tip = ip_ext; - while (tmp < buffer + ifc.ifc_len && count < 10) - { + while (tmp < buffer + ifc.ifc_len) { ifr = (struct ifreq *)tmp; tmp += HX_SIZE_OF_IFREQ(*ifr); - if (ifr->ifr_addr.sa_family == AF_INET) - { + if (ifr->ifr_addr.sa_family == AF_INET) { sinptr = (struct sockaddr_in *)&ifr->ifr_addr; - if (sinptr->sin_addr.s_addr != lhost) - { - add = ntohl(sinptr->sin_addr.s_addr); - len = g_snprintf(tip, 17, "%lu.%lu.%lu.%lu;", - ((add >> 24) & 255), - ((add >> 16) & 255), - ((add >> 8) & 255), - add & 255); - tip = &tip[len]; - count++; - continue; + if ((ntohl(sinptr->sin_addr.s_addr) >> 24) != 127) { + address_text = inet_ntoa(sinptr->sin_addr); + ips = g_slist_prepend(ips, g_strdup(address_text)); } - } + } } + } +#endif - return ip_ext; + return ips; }
--- a/libpurple/protocols/bonjour/jabber.h Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/bonjour/jabber.h Thu Feb 25 16:27:25 2010 +0900 @@ -37,7 +37,9 @@ { gint port; gint socket; + gint socket6; gint watcher_id; + gint watcher_id6; PurpleAccount *account; GSList *pending_conversations; } BonjourJabber; @@ -105,6 +107,6 @@ XepIq *xep_iq_new(void *data, XepIqType type, const char *to, const char *from, const char *id); int xep_iq_send_and_free(XepIq *iq); -const char *purple_network_get_my_ip_ext2(int fd); +GSList * bonjour_jabber_get_local_ips(int fd); #endif /* _BONJOUR_JABBER_H_ */
--- a/libpurple/protocols/bonjour/mdns_avahi.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/bonjour/mdns_avahi.c Thu Feb 25 16:27:25 2010 +0900 @@ -189,8 +189,12 @@ bb->ips = g_slist_remove(bb->ips, rd->ip); g_free((gchar *) rd->ip); } - bb->ips = g_slist_prepend(bb->ips, g_strdup(ip)); - rd->ip = bb->ips->data; + rd->ip = g_strdup(ip); + /* IPv6 goes at the front of the list and IPv4 at the end so that we "prefer" IPv6, if present */ + if (protocol == AVAHI_PROTO_INET6) + bb->ips = g_slist_prepend(bb->ips, (gchar *) rd->ip); + else + bb->ips = g_slist_append(bb->ips, (gchar *) rd->ip); } bb->port_p2pj = port; @@ -249,7 +253,7 @@ /* Make sure it isn't us */ if (purple_utf8_strcasecmp(name, account->username) != 0) { if (!avahi_service_resolver_new(avahi_service_browser_get_client(b), - interface, protocol, name, type, domain, AVAHI_PROTO_INET, + interface, protocol, name, type, domain, protocol, 0, _resolver_callback, account)) { purple_debug_warning("bonjour", "_browser_callback -- Error initiating resolver: %s\n", avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b)))); @@ -448,14 +452,14 @@ case PUBLISH_START: publish_result = avahi_entry_group_add_service_strlst( idata->group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_INET, 0, + AVAHI_PROTO_UNSPEC, 0, purple_account_get_username(data->account), LINK_LOCAL_RECORD_NAME, NULL, NULL, data->port_p2pj, lst); break; case PUBLISH_UPDATE: publish_result = avahi_entry_group_update_service_txt_strlst( idata->group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_INET, 0, + AVAHI_PROTO_UNSPEC, 0, purple_account_get_username(data->account), LINK_LOCAL_RECORD_NAME, NULL, lst); break; @@ -487,7 +491,7 @@ g_return_val_if_fail(idata != NULL, FALSE); - idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, LINK_LOCAL_RECORD_NAME, NULL, 0, _browser_callback, data->account); + idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, LINK_LOCAL_RECORD_NAME, NULL, 0, _browser_callback, data->account); if (!idata->sb) { purple_debug_error("bonjour", @@ -533,7 +537,7 @@ purple_account_get_username(data->account)); ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_INET, flags, svc_name, + AVAHI_PROTO_UNSPEC, flags, svc_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 120, avatar_data, avatar_len); g_free(svc_name); @@ -622,7 +626,7 @@ name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local", buddy->name); idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC, - AVAHI_PROTO_INET, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0, + AVAHI_PROTO_UNSPEC, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0, _buddy_icon_record_cb, buddy); g_free(name);
--- a/libpurple/protocols/irc/irc.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/irc/irc.c Thu Feb 25 16:27:25 2010 +0900 @@ -944,7 +944,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static gboolean load_plugin (PurplePlugin *plugin) {
--- a/libpurple/protocols/msn/msn.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/msn/msn.c Thu Feb 25 16:27:25 2010 +0900 @@ -2764,7 +2764,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ msn_get_account_text_table, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/mxit/mxit.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/mxit/mxit.c Thu Feb 25 16:27:25 2010 +0900 @@ -633,8 +633,9 @@ NULL, /* attention_types */ sizeof( PurplePluginProtocolInfo ), /* struct_size */ mxit_get_text_table, /* get_account_text_table */ - NULL, - NULL + NULL, /* initiate_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ };
--- a/libpurple/protocols/myspace/myspace.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/myspace/myspace.c Thu Feb 25 16:27:25 2010 +0900 @@ -3093,7 +3093,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ msim_get_account_text_table, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; /**
--- a/libpurple/protocols/novell/novell.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/novell/novell.c Thu Feb 25 16:27:25 2010 +0900 @@ -3529,7 +3529,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info = {
--- a/libpurple/protocols/oscar/flap_connection.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/oscar/flap_connection.c Thu Feb 25 16:27:25 2010 +0900 @@ -364,6 +364,12 @@ conn->connect_data = NULL; } + if (conn->gsc != NULL && conn->gsc->connect_data != NULL) + { + purple_ssl_close(conn->gsc); + conn->gsc = NULL; + } + if (conn->new_conn_data != NULL) { if (conn->type == SNAC_FAMILY_CHAT)
--- a/libpurple/protocols/oscar/libaim.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/oscar/libaim.c Thu Feb 25 16:27:25 2010 +0900 @@ -97,7 +97,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/oscar/oscar.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/oscar/oscar.c Thu Feb 25 16:27:25 2010 +0900 @@ -185,7 +185,6 @@ static int purple_parse_misses (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_clientauto (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_userinfo (OscarData *, FlapConnection *, FlapFrame *, ...); -static int purple_got_infoblock (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_motd (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_chatnav_info (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_conv_chat_join (OscarData *, FlapConnection *, FlapFrame *, ...); @@ -196,7 +195,6 @@ static int purple_icon_parseicon (OscarData *, FlapConnection *, FlapFrame *, ...); static int oscar_icon_req (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_msgack (OscarData *, FlapConnection *, FlapFrame *, ...); -static int purple_parse_ratechange (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_evilnotify (OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_searcherror(OscarData *, FlapConnection *, FlapFrame *, ...); static int purple_parse_searchreply(OscarData *, FlapConnection *, FlapFrame *, ...); @@ -3628,55 +3626,6 @@ return 1; } -static int purple_got_infoblock(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) -{ - PurpleConnection *gc = od->gc; - PurpleAccount *account = purple_connection_get_account(gc); - PurpleBuddy *b; - PurplePresence *presence; - PurpleStatus *status; - gchar *message = NULL; - - va_list ap; - aim_userinfo_t *userinfo; - - va_start(ap, fr); - userinfo = va_arg(ap, aim_userinfo_t *); - va_end(ap); - - b = purple_find_buddy(account, userinfo->bn); - if (b == NULL) - return 1; - - if (!oscar_util_valid_name_icq(userinfo->bn)) - { - if (strcmp(purple_buddy_get_name(b), userinfo->bn) != 0) - serv_got_alias(gc, purple_buddy_get_name(b), userinfo->bn); - else - serv_got_alias(gc, purple_buddy_get_name(b), NULL); - } - - presence = purple_buddy_get_presence(b); - status = purple_presence_get_active_status(presence); - - if (purple_status_is_online(status) && !purple_status_is_available(status) && - userinfo->flags & AIM_FLAG_AWAY && userinfo->away_len > 0 && - userinfo->away != NULL && userinfo->away_encoding != NULL) - { - gchar *charset = oscar_encoding_extract(userinfo->away_encoding); - message = oscar_encoding_to_utf8(account, charset, - userinfo->away, - userinfo->away_len); - g_free(charset); - purple_prpl_got_user_status(account, userinfo->bn, - purple_status_get_id(status), - "message", message, NULL); - g_free(message); - } - - return 1; -} - static int purple_parse_motd(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { char *msg;
--- a/libpurple/protocols/oscar/oscar.h Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/oscar/oscar.h Thu Feb 25 16:27:25 2010 +0900 @@ -539,7 +539,6 @@ struct { struct aim_userinfo_s *userinfo; - struct userinfo_node *requested; } locate; struct {
--- a/libpurple/protocols/qq/qq.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/qq/qq.c Thu Feb 25 16:27:25 2010 +0900 @@ -1037,7 +1037,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info = {
--- a/libpurple/protocols/silc/silc.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/silc/silc.c Thu Feb 25 16:27:25 2010 +0900 @@ -2116,7 +2116,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/simple/simple.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/simple/simple.c Thu Feb 25 16:27:25 2010 +0900 @@ -2086,7 +2086,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ };
--- a/libpurple/protocols/yahoo/libyahoo.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/yahoo/libyahoo.c Thu Feb 25 16:27:25 2010 +0900 @@ -265,7 +265,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ yahoo_get_account_text_table, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/yahoo/libyahoojp.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/yahoo/libyahoojp.c Thu Feb 25 16:27:25 2010 +0900 @@ -161,7 +161,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ yahoojp_get_account_text_table, /* get_account_text_table */ NULL, /* initiate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info =
--- a/libpurple/protocols/zephyr/zephyr.c Mon Feb 22 17:17:28 2010 +0900 +++ b/libpurple/protocols/zephyr/zephyr.c Thu Feb 25 16:27:25 2010 +0900 @@ -2908,7 +2908,8 @@ sizeof(PurplePluginProtocolInfo), /* struct_size */ NULL, /* get_account_text_table */ NULL, /* initate_media */ - NULL /* can_do_media */ + NULL, /* get_media_caps */ + NULL /* get_moods */ }; static PurplePluginInfo info = {
--- a/pidgin/gtkblist.c Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/gtkblist.c Thu Feb 25 16:27:25 2010 +0900 @@ -2665,39 +2665,30 @@ /* Altered from do_colorshift in gnome-panel */ static void -do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift) +do_alphashift(GdkPixbuf *pixbuf, int shift) { gint i, j; - gint width, height, has_alpha, srcrowstride, destrowstride; - guchar *target_pixels; - guchar *original_pixels; - guchar *pixsrc; - guchar *pixdest; + gint width, height, padding; + guchar *pixels; int val; - guchar a; - - has_alpha = gdk_pixbuf_get_has_alpha (src); - if (!has_alpha) + + if (!gdk_pixbuf_get_has_alpha(pixbuf)) return; - width = gdk_pixbuf_get_width (src); - height = gdk_pixbuf_get_height (src); - srcrowstride = gdk_pixbuf_get_rowstride (src); - destrowstride = gdk_pixbuf_get_rowstride (dest); - target_pixels = gdk_pixbuf_get_pixels (dest); - original_pixels = gdk_pixbuf_get_pixels (src); + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + padding = gdk_pixbuf_get_rowstride(pixbuf) - width * 4; + pixels = gdk_pixbuf_get_pixels(pixbuf); for (i = 0; i < height; i++) { - pixdest = target_pixels + i*destrowstride; - pixsrc = original_pixels + i*srcrowstride; for (j = 0; j < width; j++) { - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - a = *(pixsrc++); - val = a - shift; - *(pixdest++) = CLAMP(val, 0, 255); - } + pixels++; + pixels++; + pixels++; + val = *pixels - shift; + *(pixels++) = CLAMP(val, 0, 255); + } + pixels += padding; } } @@ -6373,7 +6364,7 @@ g_object_ref(G_OBJECT(gtkblist->empty_avatar)); avatar = gtkblist->empty_avatar; } else if ((!PURPLE_BUDDY_IS_ONLINE(buddy) || purple_presence_is_idle(presence))) { - do_alphashift(avatar, avatar, 77); + do_alphashift(avatar, 77); } emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy);
--- a/pidgin/pidginstock.c Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/pidginstock.c Thu Feb 25 16:27:25 2010 +0900 @@ -270,37 +270,30 @@ /* Altered from do_colorshift in gnome-panel */ static void -do_alphashift(GdkPixbuf *dest, GdkPixbuf *src) +do_alphashift(GdkPixbuf *pixbuf) { gint i, j; - gint width, height, has_alpha, srcrowstride, destrowstride; - guchar *target_pixels; - guchar *original_pixels; - guchar *pixsrc; - guchar *pixdest; + gint width, height, padding; + guchar *pixels; guchar a; - has_alpha = gdk_pixbuf_get_has_alpha (src); - if (!has_alpha) + if (!gdk_pixbuf_get_has_alpha(pixbuf)) return; - width = gdk_pixbuf_get_width (src); - height = gdk_pixbuf_get_height (src); - srcrowstride = gdk_pixbuf_get_rowstride (src); - destrowstride = gdk_pixbuf_get_rowstride (dest); - target_pixels = gdk_pixbuf_get_pixels (dest); - original_pixels = gdk_pixbuf_get_pixels (src); + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + padding = gdk_pixbuf_get_rowstride(pixbuf) - width * 4; + pixels = gdk_pixbuf_get_pixels(pixbuf); for (i = 0; i < height; i++) { - pixdest = target_pixels + i*destrowstride; - pixsrc = original_pixels + i*srcrowstride; for (j = 0; j < width; j++) { - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - *(pixdest++) = *(pixsrc++); - a = *(pixsrc++); - *(pixdest++) = a / 2; + pixels++; + pixels++; + pixels++; + a = *(pixels); + *(pixels++) = a / 2; } + pixels += padding; } } @@ -348,7 +341,7 @@ g_return_if_fail(filename != NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); if (translucent) - do_alphashift(pixbuf, pixbuf); + do_alphashift(pixbuf); source = gtk_icon_source_new(); gtk_icon_source_set_pixbuf(source, pixbuf); @@ -378,7 +371,7 @@ g_return_if_fail(filename != NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); if (translucent) - do_alphashift(pixbuf, pixbuf); + do_alphashift(pixbuf); source = gtk_icon_source_new(); gtk_icon_source_set_pixbuf(source, pixbuf);
--- a/pidgin/pixmaps/Makefile.am Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/pixmaps/Makefile.am Thu Feb 25 16:27:25 2010 +0900 @@ -203,7 +203,7 @@ emotes/default/24/scalable/yin-yang.svg EMOTES_SMALL_16_SCALABLE = \ - emotes/small/16/scalable/mobile.svg + emotes/small/16/scalable/mobile.svg \ emotes/small/16/scalable/pidgin-emotes.svg PROTOCOLS_16_SCALABLE = \
--- a/pidgin/win32/nsis/langmacros.nsh Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/win32/nsis/langmacros.nsh Thu Feb 25 16:27:25 2010 +0900 @@ -91,8 +91,10 @@ !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_SPELLCHECK_SWEDISH ${CUR_LANG} !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_SPELLCHECK_UKRAINIAN ${CUR_LANG} - !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_DEBUGSYMBOLS_ERROR ${CUR_LANG} - !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_GTK_DOWNLOAD_ERROR ${CUR_LANG} + !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_DEBUGSYMBOLS_ERROR ${CUR_LANG} + !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_GTK_DOWNLOAD_ERROR ${CUR_LANG} + + !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT TRANSLATIONS_SECTION_TITLE ${CUR_LANG} !undef CUR_LANG !macroend
--- a/pidgin/win32/nsis/pidgin-installer.nsi Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/win32/nsis/pidgin-installer.nsi Thu Feb 25 16:27:25 2010 +0900 @@ -53,7 +53,7 @@ ;Defines !define PIDGIN_NSIS_INCLUDE_PATH "." -!define PIDGIN_INSTALLER_DEPS "..\..\..\..\win32-dev\pidgin-inst-deps-0.2" +!define PIDGIN_INSTALLER_DEPS "..\..\..\..\win32-dev\pidgin-inst-deps-20100223" ; Remove these and the stuff that uses them at some point !define OLD_GAIM_REG_KEY "SOFTWARE\gaim" @@ -779,7 +779,7 @@ Delete "$INSTDIR\libsasl.dll" Delete "$INSTDIR\libsilc-1-1-2.dll" Delete "$INSTDIR\libsilcclient-1-1-2.dll" - Delete "$INSTDIR\libxml2.dll" + Delete "$INSTDIR\libxml2-2.dll" Delete "$INSTDIR\libymsg.dll" Delete "$INSTDIR\nspr4.dll" Delete "$INSTDIR\nss3.dll"
--- a/pidgin/win32/nsis/translations/english.nsh Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/win32/nsis/translations/english.nsh Thu Feb 25 16:27:25 2010 +0900 @@ -25,13 +25,14 @@ !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SHORTCUTS_SECTION_TITLE "Shortcuts" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DESKTOP_SHORTCUT_SECTION_TITLE "Desktop" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_STARTMENU_SHORTCUT_SECTION_TITLE "Start Menu" +!insertmacro PIDGIN_MACRO_DEFAULT_STRING TRANSLATIONS_SECTION_TITLE "Localizations" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SECTION_DESCRIPTION "Core Pidgin files and dlls" !insertmacro PIDGIN_MACRO_DEFAULT_STRING GTK_SECTION_DESCRIPTION "A multi-platform GUI toolkit, used by Pidgin" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SHORTCUTS_SECTION_DESCRIPTION "Shortcuts for starting Pidgin" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DESKTOP_SHORTCUT_DESC "Create a shortcut to Pidgin on the Desktop" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_STARTMENU_SHORTCUT_DESC "Create a Start Menu entry for Pidgin" -!insertmacro PIDGIN_MACRO_DEFAULT_STRING DEBUG_SYMBOLS_SECTION_TITLE "Debug Symbols (for reporting crashes)" +!insertmacro PIDGIN_MACRO_DEFAULT_STRING DEBUG_SYMBOLS_SECTION_TITLE "Debug Symbols (for reporting crashes)" ; GTK+ Directory Page @@ -79,6 +80,7 @@ !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_SWEDISH "Swedish" !insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_UKRAINIAN "Ukrainian" -!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DEBUGSYMBOLS_ERROR "Error Installing Debug Symbols" +!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DEBUGSYMBOLS_ERROR "Error Installing Debug Symbols" -!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_GTK_DOWNLOAD_ERROR "Error Downloading the GTK+ Runtime" +!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_GTK_DOWNLOAD_ERROR "Error Downloading the GTK+ Runtime" +
--- a/pidgin/win32/nsis/translations/norwegian_nynorsk.nsh Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/win32/nsis/translations/norwegian_nynorsk.nsh Thu Feb 25 16:27:25 2010 +0900 @@ -9,7 +9,6 @@ ; Startup Checks !define INSTALLER_IS_RUNNING "Installasjonsprogrammet kjører allereie." !define PIDGIN_IS_RUNNING "Pidgin kjører no. Lukk programmet og prøv igjen." -!define GTK_INSTALLER_NEEDED "GTK+-kjøremiljøet manglar eller treng å bli oppdatert.$\rInstaller v${GTK_MIN_VERSION} eller nyare av GTK+-kjøremiljøet" ; License Page !define PIDGIN_LICENSE_BUTTON "Neste >" @@ -28,20 +27,12 @@ !define PIDGIN_DESKTOP_SHORTCUT_DESC "Lag ein snarveg til Pidgin på skrivebordet" !define PIDGIN_STARTMENU_SHORTCUT_DESC "Lag ein snarveg til Pidgin på startmenyen" -; GTK+ Directory Page -!define GTK_UPGRADE_PROMPT "Fann ei gammal utgåve av GTK+-kjøremiljøet. Vil du oppdatera ho?$\rMerk: $(^Name) vil kanskje ikkje fungera om du ikkje oppdaterer." -!define GTK_WINDOWS_INCOMPATIBLE "Windows 95/98/Me er ikkje kompatibelt med GTK+ 2.8.0 eller nyare. GTK+ ${GTK_INSTALL_VERSION} kjem ikkje til å bli installert.$\rInstallasjonen vil bli abvroten om ikkje GTK+ ${GTK_MIN_VERSION} eller nyare allereie er installert." - ; Installer Finish Page !define PIDGIN_FINISH_VISIT_WEB_SITE "Besøk Pidgin si nettside" ; Pidgin Section Prompts and Texts !define PIDGIN_PROMPT_CONTINUE_WITHOUT_UNINSTALL "Klarte ikkje å avinstallera Pidgin-utgåva som er i bruk. Den nye utgåva kjem til å bli installert utan å ta vekk den gjeldande." -; GTK+ Section Prompts -!define GTK_INSTALL_ERROR "Klarte ikkje å installera GTK+-kjøremiljøet." -!define GTK_BAD_INSTALL_PATH "Klarer ikkje å laga eller få tilgang til bana du skreiv." - ; URL Handler section !define URI_HANDLERS_SECTION_TITLE "URI-referanse"
--- a/pidgin/win32/nsis/translations/polish.nsh Mon Feb 22 17:17:28 2010 +0900 +++ b/pidgin/win32/nsis/translations/polish.nsh Thu Feb 25 16:27:25 2010 +0900 @@ -25,17 +25,9 @@ !define PIDGIN_DESKTOP_SHORTCUT_DESC "Utworzenie skrótu do programu Pidgin na pulpicie" !define PIDGIN_STARTMENU_SHORTCUT_DESC "Utworzenie wpisu w menu Start dla programu Pidgin" -; GTK+ Directory Page -!define GTK_UPGRADE_PROMPT "Odnaleziono star¹ wersjê biblioteki GTK+. Zaktualizowaæ j¹?$\rUwaga: program $(^Name) mo¿e bez tego nie dzia³aæ." -!define GTK_WINDOWS_INCOMPATIBLE "Systemy Windows 95/98/Me s¹ niezgodne z bibliotek¹ GTK+ 2.8.0 lub nowsz¹. Biblioteka GTK+ ${GTK_INSTALL_VERSION} nie zostanie zainstalowana.$\rJeli brak zainstalowanej biblioteki GTK+ ${GTK_MIN_VERSION} lub nowszej, instalacja zostanie przerwana." - ; Installer Finish Page !define PIDGIN_FINISH_VISIT_WEB_SITE "Odwied stronê WWW programu Pidgin" -; GTK+ Section Prompts -!define GTK_INSTALL_ERROR "B³¹d podczas instalowania biblioteki GTK+." -!define GTK_BAD_INSTALL_PATH "Nie mo¿na uzyskaæ dostêpu do podanej cie¿ki lub jej utworzyæ." - ; Uninstall Section Prompts !define un.PIDGIN_UNINSTALL_ERROR_1 "Instalator nie mo¿e odnaleæ wpisów w rejestrze dla programu Pidgin.$\rMo¿liwe, ¿e inny u¿ytkownik zainstalowa³ ten program." -!define un.PIDGIN_UNINSTALL_ERROR_2 "Brak uprawnieñ do odinstalowania tego programu." \ No newline at end of file +!define un.PIDGIN_UNINSTALL_ERROR_2 "Brak uprawnieñ do odinstalowania tego programu."