/pidgin/main: 4854740e5277: Merge with release-2.x.y (lots of co...
Daniel Atallah
datallah at pidgin.im
Tue Feb 26 19:11:36 EST 2013
Changeset: 4854740e52770b84ab04e6ccd7f243c1ba5bc0a7
Author: Daniel Atallah <datallah at pidgin.im>
Date: 2013-02-26 19:11 -0500
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/4854740e5277
Description:
Merge with release-2.x.y (lots of conflicts, but all trivially resolved)
* I resolved de.po by keeping what was in default already because it had been
manually merged earlier.
diffstat:
configure.ac | 4 +-
libpurple/account.c | 6 +-
libpurple/buddyicon.c | 2 +-
libpurple/plugin.c | 2 +-
libpurple/pounce.c | 2 +-
libpurple/protocols/bonjour/jabber.c | 27 ++++------
libpurple/protocols/jabber/auth_digest_md5.c | 4 +-
libpurple/protocols/jabber/google/google_session.c | 13 ++--
libpurple/protocols/jabber/jabber.c | 55 +++++++++++----------
libpurple/protocols/jabber/jingle/rtp.c | 3 +-
libpurple/protocols/msn/directconn.c | 14 ++--
libpurple/protocols/mxit/login.c | 2 +-
libpurple/protocols/mxit/multimx.c | 3 +-
libpurple/protocols/novell/nmrtf.c | 1 -
libpurple/protocols/novell/novell.c | 4 -
libpurple/protocols/oscar/userinfo.c | 4 -
libpurple/protocols/sametime/sametime.c | 3 +-
libpurple/protocols/silc/buddy.c | 18 ++----
libpurple/protocols/silc/ops.c | 14 ++---
libpurple/protocols/simple/simple.c | 6 +-
libpurple/protocols/yahoo/yahoo_doodle.c | 6 +-
libpurple/protocols/zephyr/zephyr.c | 14 ++---
libpurple/smiley.c | 29 +++++------
pidgin/gtkconv.c | 2 +-
pidgin/gtkmain.c | 5 +-
pidgin/gtknotify.c | 2 +-
pidgin/gtkpounce.c | 6 +-
pidgin/gtksourceundomanager.c | 17 ++----
pidgin/gtkutils.c | 6 +-
pidgin/plugins/gevolution/add_buddy_dialog.c | 4 +-
pidgin/plugins/gevolution/gevolution.c | 2 +-
31 files changed, 119 insertions(+), 161 deletions(-)
diffs (truncated from 888 to 300 lines):
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2440,12 +2440,12 @@ fi
AC_SUBST(PLUGINS_DEFINE)
dnl #######################################################################
-dnl # Check for Cyrus-SASL (for Jabber)
+dnl # Check for Cyrus-SASL (for xmpp/irc)
dnl #######################################################################
dnl AC_CHECK_SIZEOF(short)
AC_CHECK_FUNCS(snprintf connect)
AC_SUBST(SASL_LIBS)
-AC_ARG_ENABLE(cyrus-sasl, AS_HELP_STRING([--enable-cyrus-sasl], [enable Cyrus SASL support for jabberd]), enable_cyrus_sasl=$enableval, enable_cyrus_sasl=no)
+AC_ARG_ENABLE(cyrus-sasl, AS_HELP_STRING([--enable-cyrus-sasl], [enable Cyrus SASL support for xmpp/irc]), enable_cyrus_sasl=$enableval, enable_cyrus_sasl=no)
if test "x$enable_cyrus_sasl" = "xyes" ; then
AC_CHECK_LIB(sasl2, sasl_client_init, [
AM_CONDITIONAL(USE_CYRUS_SASL, true)
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1535,7 +1535,7 @@ purple_account_request_change_password(P
field = purple_request_field_string_new("password", _("Original password"),
NULL, FALSE);
purple_request_field_string_set_masked(field, TRUE);
- if (!(prpl_info && (prpl_info->options | OPT_PROTO_PASSWORD_OPTIONAL)))
+ if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
purple_request_field_set_required(field, TRUE);
purple_request_field_group_add_field(group, field);
@@ -1543,7 +1543,7 @@ purple_account_request_change_password(P
_("New password"),
NULL, FALSE);
purple_request_field_string_set_masked(field, TRUE);
- if (!(prpl_info && (prpl_info->options | OPT_PROTO_PASSWORD_OPTIONAL)))
+ if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
purple_request_field_set_required(field, TRUE);
purple_request_field_group_add_field(group, field);
@@ -1551,7 +1551,7 @@ purple_account_request_change_password(P
_("New password (again)"),
NULL, FALSE);
purple_request_field_string_set_masked(field, TRUE);
- if (!(prpl_info && (prpl_info->options | OPT_PROTO_PASSWORD_OPTIONAL)))
+ if (!prpl_info || !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
purple_request_field_set_required(field, TRUE);
purple_request_field_group_add_field(group, field);
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -438,7 +438,7 @@ purple_buddy_icon_update(PurpleBuddyIcon
purple_conv_im_set_icon(PURPLE_CONV_IM(conv), icon_to_set);
/* icon's refcount was incremented above */
- if (icon) purple_buddy_icon_unref(icon);
+ purple_buddy_icon_unref(icon);
}
void
diff --git a/libpurple/plugin.c b/libpurple/plugin.c
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -1362,7 +1362,7 @@ purple_plugins_probe(const char *ext)
path = g_build_filename(search_path, file, NULL);
if (ext == NULL || has_file_extension(file, ext))
- plugin = purple_plugin_probe(path);
+ purple_plugin_probe(path);
g_free(path);
}
diff --git a/libpurple/pounce.c b/libpurple/pounce.c
--- a/libpurple/pounce.c
+++ b/libpurple/pounce.c
@@ -245,7 +245,7 @@ pounce_to_xmlnode(PurplePounce *pounce)
g_hash_table_foreach(pounce->actions, action_parameter_list_to_xmlnode, child);
if (purple_pounce_get_save(pounce))
- child = xmlnode_new_child(node, "save");
+ xmlnode_new_child(node, "save");
return node;
}
diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -181,7 +181,7 @@ static void
/* Types of messages sent by iChat */
if (html_body_font_node != NULL) {
gchar *html_body;
- const char *font_face, *font_size, *font_color,
+ const char *font_face, *font_size,
*ichat_balloon_color, *ichat_text_color;
font_face = xmlnode_get_attrib(html_body_font_node, "face");
@@ -189,7 +189,7 @@ static void
font_size = xmlnode_get_attrib(html_body_font_node, "ABSZ");
if (font_size != NULL)
font_size = _font_size_ichat_to_purple(atoi(font_size));
- font_color = xmlnode_get_attrib(html_body_font_node, "color");
+ /*font_color = xmlnode_get_attrib(html_body_font_node, "color");*/
ichat_balloon_color = xmlnode_get_attrib(html_body_node, "ichatballooncolor");
ichat_text_color = xmlnode_get_attrib(html_body_node, "ichattextcolor");
@@ -413,16 +413,18 @@ static void
_client_socket_handler(gpointer data, gint socket, PurpleInputCondition condition)
{
BonjourJabberConversation *bconv = data;
- gint len, message_length;
+ gssize len;
static char message[4096];
/* Read the data from the socket */
- if ((len = recv(socket, message, sizeof(message) - 1, 0)) == -1) {
+ if ((len = recv(socket, message, sizeof(message) - 1, 0)) < 0) {
/* There have been an error reading from the socket */
- if (errno != EAGAIN) {
+ if (len != -1 || errno != EAGAIN) {
const char *err = g_strerror(errno);
- purple_debug_warning("bonjour", "receive error: %s\n", err ? err : "(null)");
+ purple_debug_warning("bonjour",
+ "receive of %" G_GSSIZE_FORMAT " error: %s\n",
+ len, err ? err : "(null)");
bonjour_jabber_close_conversation(bconv);
if (bconv->pb != NULL) {
@@ -441,19 +443,12 @@ static void
purple_debug_warning("bonjour", "Connection closed (without stream end) by %s.\n", (name) ? name : "(unknown)");
bonjour_jabber_stream_ended(bconv);
return;
- } else {
- message_length = len;
- message[message_length] = '\0';
-
- while (message_length > 0 && g_ascii_iscntrl(message[message_length - 1])) {
- message[message_length - 1] = '\0';
- message_length--;
- }
}
- purple_debug_info("bonjour", "Receive: -%s- %d bytes\n", message, len);
+ message[len] = '\0';
- bonjour_parser_process(bconv, message, message_length);
+ purple_debug_info("bonjour", "Receive: -%s- %" G_GSSIZE_FORMAT " bytes\n", message, len);
+ bonjour_parser_process(bconv, message, len);
}
struct _stream_start_data {
diff --git a/libpurple/protocols/jabber/auth_digest_md5.c b/libpurple/protocols/jabber/auth_digest_md5.c
--- a/libpurple/protocols/jabber/auth_digest_md5.c
+++ b/libpurple/protocols/jabber/auth_digest_md5.c
@@ -184,8 +184,8 @@ digest_md5_handle_challenge(JabberStream
dec_in = (char *)purple_base64_decode(enc_in, NULL);
purple_debug_misc("jabber", "decoded challenge (%"
G_GSIZE_FORMAT "): %s\n",
- dec_in != NULL ? strlen(dec_in) : 0,
- dec_in != NULL ? dec_in : "(null)");
+ strlen(dec_in),
+ dec_in);
parts = jabber_auth_digest_md5_parse(dec_in);
diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c
--- a/libpurple/protocols/jabber/google/google_session.c
+++ b/libpurple/protocols/jabber/google/google_session.c
@@ -501,8 +501,7 @@ jabber_google_relay_response_session_han
for (codec_element = xmlnode_get_child(session->description, "payload-type");
codec_element; codec_element = codec_element->next) {
- const char *id, *encoding_name, *clock_rate,
- *width, *height, *framerate;
+ const char *id, *encoding_name, *clock_rate;
gboolean video;
if (codec_element->name &&
strcmp(codec_element->name, "payload-type"))
@@ -518,10 +517,10 @@ jabber_google_relay_response_session_han
codec_element, "clockrate");
video = FALSE;
} else {
- width = xmlnode_get_attrib(codec_element, "width");
+ /*width = xmlnode_get_attrib(codec_element, "width");
height = xmlnode_get_attrib(codec_element, "height");
framerate = xmlnode_get_attrib(
- codec_element, "framerate");
+ codec_element, "framerate");*/
clock_rate = "90000";
video = TRUE;
}
@@ -716,7 +715,7 @@ google_session_handle_accept(JabberStrea
for (; codec_element; codec_element = codec_element->next) {
const gchar *xmlns, *encoding_name, *id,
- *clock_rate, *width, *height, *framerate;
+ *clock_rate;
gboolean video_codec = FALSE;
if (!purple_strequal(codec_element->name, "payload-type"))
@@ -731,10 +730,10 @@ google_session_handle_accept(JabberStrea
codec_element, "clockrate");
else {
clock_rate = "90000";
- width = xmlnode_get_attrib(codec_element, "width");
+ /*width = xmlnode_get_attrib(codec_element, "width");
height = xmlnode_get_attrib(codec_element, "height");
framerate = xmlnode_get_attrib(
- codec_element, "framerate");
+ codec_element, "framerate");*/
video_codec = TRUE;
}
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -3295,7 +3295,7 @@ jabber_initiate_media(PurpleAccount *acc
JabberStream *js = purple_connection_get_protocol_data(gc);
JabberBuddy *jb;
JabberBuddyResource *jbr = NULL;
- char *resource;
+ char *resource = NULL;
if (!js) {
purple_debug_error("jabber",
@@ -3303,43 +3303,44 @@ jabber_initiate_media(PurpleAccount *acc
return FALSE;
}
- if((resource = jabber_get_resource(who)) != NULL) {
+ jb = jabber_buddy_find(js, who, FALSE);
+
+ if(!jb || !jb->resources ||
+ (((resource = jabber_get_resource(who)) != NULL)
+ && (jbr = jabber_buddy_find_resource(jb, resource)) == NULL)) {
+ /* no resources online, we're trying to initiate with someone
+ * whose presence we're not subscribed to, or
+ * someone who is offline. Let's inform the user */
+ char *msg;
+
+ if(!jb) {
+ msg = g_strdup_printf(_("Unable to initiate media with %s: invalid JID"), who);
+ } else if(jb->subscription & JABBER_SUB_TO && !jb->resources) {
+ msg = g_strdup_printf(_("Unable to initiate media with %s: user is not online"), who);
+ } else if(resource) {
+ msg = g_strdup_printf(_("Unable to initiate media with %s: resource is not online"), who);
+ } else {
+ msg = g_strdup_printf(_("Unable to initiate media with %s: not subscribed to user presence"), who);
+ }
+
+ purple_notify_error(account, _("Media Initiation Failed"),
+ _("Media Initiation Failed"), msg);
+ g_free(msg);
+ g_free(resource);
+ return FALSE;
+ } else if(jbr != NULL) {
/* they've specified a resource, no need to ask or
* default or anything, just do it */
- jb = jabber_buddy_find(js, who, FALSE);
- jbr = jabber_buddy_find_resource(jb, resource);
g_free(resource);
if (type & PURPLE_MEDIA_AUDIO &&
!jabber_resource_has_capability(jbr,
- JINGLE_APP_RTP_SUPPORT_AUDIO) &&
+ JINGLE_APP_RTP_SUPPORT_AUDIO) &&
jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE))
return jabber_google_session_initiate(js, who, type);
else
return jingle_rtp_initiate_media(js, who, type);
- }
-
- jb = jabber_buddy_find(js, who, FALSE);
-
- if(!jb || !jb->resources) {
- /* no resources online, we're trying to initiate with someone
- * whose presence we're not subscribed to, or
- * someone who is offline. Let's inform the user */
- char *msg;
-
- if(!jb) {
- msg = g_strdup_printf(_("Unable to initiate media with %s: invalid JID"), who);
- } else if(jb->subscription & JABBER_SUB_TO) {
- msg = g_strdup_printf(_("Unable to initiate media with %s: user is not online"), who);
- } else {
- msg = g_strdup_printf(_("Unable to initiate media with %s: not subscribed to user presence"), who);
- }
-
- purple_notify_error(account, _("Media Initiation Failed"),
- _("Media Initiation Failed"), msg);
- g_free(msg);
- return FALSE;
} else if(!jb->resources->next) {
/* only 1 resource online (probably our most common case)
* so no need to ask who to initiate with */
diff --git a/libpurple/protocols/jabber/jingle/rtp.c b/libpurple/protocols/jabber/jingle/rtp.c
--- a/libpurple/protocols/jabber/jingle/rtp.c
+++ b/libpurple/protocols/jabber/jingle/rtp.c
@@ -851,7 +851,8 @@ jingle_rtp_initiate_media(JabberStream *
More information about the Commits
mailing list