pidgin/pidgin

Merged in default (pull request #669)

2020-02-14, Gary Kramlich
90be91762626
Merged in default (pull request #669)

Shrink the delta from PR 666

Approved-by: Gary Kramlich
Approved-by: Elliott Sales de Andrade
--- a/libpurple/conversation.h Fri Feb 14 07:46:31 2020 +0000
+++ b/libpurple/conversation.h Fri Feb 14 22:55:41 2020 +0000
@@ -133,21 +133,21 @@
*/
typedef enum /*< flags >*/
{
- PURPLE_MESSAGE_SEND = 0x0001,
- PURPLE_MESSAGE_RECV = 0x0002,
- PURPLE_MESSAGE_SYSTEM = 0x0004,
- PURPLE_MESSAGE_AUTO_RESP = 0x0008,
- PURPLE_MESSAGE_ACTIVE_ONLY = 0x0010,
- PURPLE_MESSAGE_NICK = 0x0020,
- PURPLE_MESSAGE_NO_LOG = 0x0040,
- PURPLE_MESSAGE_ERROR = 0x0200,
- PURPLE_MESSAGE_DELAYED = 0x0400,
- PURPLE_MESSAGE_RAW = 0x0800,
- PURPLE_MESSAGE_IMAGES = 0x1000,
- PURPLE_MESSAGE_NOTIFY = 0x2000,
- PURPLE_MESSAGE_NO_LINKIFY = 0x4000,
- PURPLE_MESSAGE_INVISIBLE = 0x8000,
- PURPLE_MESSAGE_REMOTE_SEND = 0x10000
+ PURPLE_MESSAGE_SEND = 1 << 0,
+ PURPLE_MESSAGE_RECV = 1 << 1,
+ PURPLE_MESSAGE_SYSTEM = 1 << 2,
+ PURPLE_MESSAGE_AUTO_RESP = 1 << 3,
+ PURPLE_MESSAGE_ACTIVE_ONLY = 1 << 4,
+ PURPLE_MESSAGE_NICK = 1 << 5,
+ PURPLE_MESSAGE_NO_LOG = 1 << 6,
+ PURPLE_MESSAGE_ERROR = 1 << 7,
+ PURPLE_MESSAGE_DELAYED = 1 << 8,
+ PURPLE_MESSAGE_RAW = 1 << 9,
+ PURPLE_MESSAGE_IMAGES = 1 << 10,
+ PURPLE_MESSAGE_NOTIFY = 1 << 11,
+ PURPLE_MESSAGE_NO_LINKIFY = 1 << 12,
+ PURPLE_MESSAGE_INVISIBLE = 1 << 13,
+ PURPLE_MESSAGE_REMOTE_SEND = 1 << 14,
} PurpleMessageFlags;
#include <glib.h>
--- a/libpurple/protocols/jabber/jabber.c Fri Feb 14 07:46:31 2020 +0000
+++ b/libpurple/protocols/jabber/jabber.c Fri Feb 14 22:55:41 2020 +0000
@@ -345,11 +345,11 @@
name = (*packet)->name;
xmlns = purple_xmlnode_get_namespace(*packet);
- if(purple_strequal((*packet)->name, "iq")) {
+ if (purple_strequal(name, "iq")) {
jabber_iq_parse(js, *packet);
- } else if(purple_strequal((*packet)->name, "presence")) {
+ } else if (purple_strequal(name, "presence")) {
jabber_presence_parse(js, *packet);
- } else if(purple_strequal((*packet)->name, "message")) {
+ } else if (purple_strequal(name, "message")) {
jabber_message_parse(js, *packet);
} else if (purple_strequal(xmlns, NS_XMPP_STREAMS)) {
if (purple_strequal(name, "features"))
@@ -377,7 +377,7 @@
/* TODO: Handle <failure/>, I guess? */
}
} else {
- purple_debug_warning("jabber", "Unknown packet: %s\n", (*packet)->name);
+ purple_debug_warning("jabber", "Unknown packet: %s\n", name);
}
}
@@ -2574,7 +2574,7 @@
jabber_user_search_begin);
m = g_list_append(m, act);
- purple_debug_info("jabber", "jabber_get_actions: have pep: %s\n", js->pep?"YES":"NO");
+ purple_debug_info("jabber", "jabber_get_actions: have pep: %s\n", js->pep ? "YES" : "NO");
if(js->pep)
jabber_pep_init_actions(&m);
@@ -3706,7 +3706,7 @@
id = purple_cmd_register("buzz", "w", PURPLE_CMD_P_PROTOCOL,
PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PROTOCOL_ONLY |
PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, proto_id, jabber_cmd_buzz,
- _("buzz: Buzz a user to get their attention"), NULL);
+ _("buzz: Buzz a user to get their attention."), NULL);
commands = g_slist_prepend(commands, GUINT_TO_POINTER(id));
id = purple_cmd_register("mood", "ws", PURPLE_CMD_P_PROTOCOL,
--- a/libpurple/protocols/jabber/jabber.h Fri Feb 14 07:46:31 2020 +0000
+++ b/libpurple/protocols/jabber/jabber.h Fri Feb 14 22:55:41 2020 +0000
@@ -43,8 +43,8 @@
JABBER_CAP_GMAIL_NOTIFY = 1 << 9,
JABBER_CAP_GOOGLE_ROSTER = 1 << 10,
- JABBER_CAP_PING = 1 << 11,
- JABBER_CAP_ADHOC = 1 << 12,
+ JABBER_CAP_PING = 1 << 11,
+ JABBER_CAP_ADHOC = 1 << 12,
JABBER_CAP_BLOCKING = 1 << 13,
JABBER_CAP_ITEMS = 1 << 14,
--- a/libpurple/protocols/jabber/message.c Fri Feb 14 07:46:31 2020 +0000
+++ b/libpurple/protocols/jabber/message.c Fri Feb 14 22:55:41 2020 +0000
@@ -107,7 +107,8 @@
static void handle_chat(JabberMessage *jm)
{
- JabberID *jid = jabber_id_new(jm->from);
+ const gchar *contact = jm->from;
+ JabberID *jid = jabber_id_new(contact);
PurpleConnection *gc;
PurpleAccount *account;
@@ -121,7 +122,7 @@
gc = jm->js->gc;
account = purple_connection_get_account(gc);
- jb = jabber_buddy_find(jm->js, jm->from, TRUE);
+ jb = jabber_buddy_find(jm->js, contact, TRUE);
jbr = jabber_buddy_find_resource(jb, jid->resource);
if (jbr && jm->chat_state != JM_STATE_NONE)
@@ -129,14 +130,14 @@
switch(jm->chat_state) {
case JM_STATE_COMPOSING:
- purple_serv_got_typing(gc, jm->from, 0, PURPLE_IM_TYPING);
+ purple_serv_got_typing(gc, contact, 0, PURPLE_IM_TYPING);
break;
case JM_STATE_PAUSED:
- purple_serv_got_typing(gc, jm->from, 0, PURPLE_IM_TYPED);
+ purple_serv_got_typing(gc, contact, 0, PURPLE_IM_TYPED);
break;
case JM_STATE_GONE: {
PurpleIMConversation *im = purple_conversations_find_im_with_account(
- jm->from, account);
+ contact, account);
if (im && jid->node && jid->domain) {
char buf[256];
PurpleBuddy *buddy;
@@ -161,11 +162,11 @@
PURPLE_CONVERSATION(im), buf, 0);
}
}
- purple_serv_got_typing_stopped(gc, jm->from);
+ purple_serv_got_typing_stopped(gc, contact);
break;
}
default:
- purple_serv_got_typing_stopped(gc, jm->from);
+ purple_serv_got_typing_stopped(gc, contact);
}
if (jm->js->googletalk && jm->body && jm->xhtml == NULL) {
@@ -189,12 +190,12 @@
*/
PurpleIMConversation *im;
- im = purple_conversations_find_im_with_account(jm->from, account);
- if (im && !purple_strequal(jm->from,
+ im = purple_conversations_find_im_with_account(contact, account);
+ if (im && !purple_strequal(contact,
purple_conversation_get_name(PURPLE_CONVERSATION(im)))) {
purple_debug_info("jabber", "Binding conversation to %s\n",
- jm->from);
- purple_conversation_set_name(PURPLE_CONVERSATION(im), jm->from);
+ contact);
+ purple_conversation_set_name(PURPLE_CONVERSATION(im), contact);
}
}
@@ -211,7 +212,7 @@
jbr->thread_id = g_strdup(jm->thread_id);
}
- purple_serv_got_im(gc, jm->from, body->str, 0, jm->sent);
+ purple_serv_got_im(gc, contact, body->str, 0, jm->sent);
}
jabber_id_free(jid);
@@ -489,7 +490,7 @@
static void
jabber_message_add_remote_smileys(JabberStream *js, const gchar *who,
- const PurpleXmlNode *message)
+ const PurpleXmlNode *message)
{
PurpleXmlNode *data_tag;
for (data_tag = purple_xmlnode_get_child_with_namespace(message, "data", NS_BOB) ;
@@ -873,8 +874,7 @@
static gboolean
jabber_conv_support_custom_smileys(JabberStream *js,
- PurpleConversation *conv,
- const gchar *who)
+ PurpleConversation *conv, const gchar *who)
{
JabberBuddy *jb;
JabberChat *chat;
@@ -1110,8 +1110,7 @@
* FALSE.
*/
static gboolean
-jabber_xhtml_plain_equal(const char *xhtml_escaped,
- const char *plain)
+jabber_xhtml_plain_equal(const char *xhtml_escaped, const char *plain)
{
int i = 0;
int j = 0;