From 188b75e113480aa4237d77927e3f53993ac4992a Mon Sep 17 00:00:00 2001 From: dequis Date: Tue, 3 Jan 2017 00:32:37 -0300 Subject: oscar: fix checkdisallowed condition, which was breaking login. Accidentally broke it in d57484d (from last week) --- protocols/oscar/rxhandlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') 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; -- cgit v1.2.3 From 3b8e4be6374cf43d15957ac255ebf2df14fe4c50 Mon Sep 17 00:00:00 2001 From: dequis Date: Tue, 3 Jan 2017 03:30:38 -0300 Subject: purple: show self-messages in groupchat backlogs (before join) That is, flagged with PURPLE_MESSAGE_DELAYED. Those are safe to display. This is similar to what adium does. Thanks EionRobb for the idea. --- protocols/purple/purple.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 4333d903..0b74c8d8 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -1196,11 +1196,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); } } -- cgit v1.2.3