aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-01-07 18:52:57 +0100
committerMarius Halden <marius.h@lden.org>2017-01-07 18:52:57 +0100
commit52ac0e03b0e69f43f6556a568bf82dabf3e5e4f0 (patch)
tree33172cdc77f9eb2bbb357533535a8477192e630e /protocols
parentefaa514039a4b907e2c5c6309295c66b27b1f691 (diff)
parent3b8e4be6374cf43d15957ac255ebf2df14fe4c50 (diff)
Merge branch 'master' into patched-master
Diffstat (limited to 'protocols')
-rw-r--r--protocols/oscar/rxhandlers.c2
-rw-r--r--protocols/purple/purple.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/protocols/oscar/rxhandlers.c b/protocols/oscar/rxhandlers.c
index 0f1bb3d7..156563eb 100644
--- a/protocols/oscar/rxhandlers.c
+++ b/protocols/oscar/rxhandlers.c
@@ -235,7 +235,7 @@ int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, g
struct aim_rxcblist_s *newcb;
g_return_val_if_fail(conn, -1);
- g_return_val_if_fail(checkdisallowed(family, type), -1);
+ g_return_val_if_fail(!checkdisallowed(family, type), -1);
if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) {
return -1;
diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c
index fbc5f45e..64faadfb 100644
--- a/protocols/purple/purple.c
+++ b/protocols/purple/purple.c
@@ -1210,11 +1210,15 @@ static void handle_conv_msg(PurpleConversation *conv, const char *who, const cha
g_free(message);
}
-/* Handles write_im and write_chat. Removes echoes of locally sent messages */
+/* Handles write_im and write_chat. Removes echoes of locally sent messages.
+ *
+ * PURPLE_MESSAGE_DELAYED is used for chat backlogs - if a message has both
+ * that flag and _SEND, it's a self-message from before joining the channel.
+ * Those are safe to display. The rest (with just _SEND) may be echoes. */
static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
{
- if (!(flags & PURPLE_MESSAGE_SEND)) {
- handle_conv_msg(conv, who, message, 0, mtime);
+ if ((!(flags & PURPLE_MESSAGE_SEND)) || (flags & PURPLE_MESSAGE_DELAYED)) {
+ handle_conv_msg(conv, who, message, (flags & PURPLE_MESSAGE_SEND) ? OPT_SELFMESSAGE : 0, mtime);
}
}