summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Landau <daniel@landau.fi>2016-11-09 21:27:11 +0200
committerAlexander Akulich <akulichalexander@gmail.com>2020-11-01 01:53:10 +0300
commit71ea7e98a1e68c5a51b0a36e662a95d07a04a3d7 (patch)
treef68eb03c4f1c9aebb5b30b60e6d447ce95bc459d /src
parentc1ae3d2bdc7801cdf60adb6a5cdb6390a0749014 (diff)
Handle modechars properly
Never strip out modechars unless we are explicitly trying to parse a nickname with modechars, i.e., atom 'C'
Diffstat (limited to 'src')
-rw-r--r--src/idle-parser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/idle-parser.c b/src/idle-parser.c
index 2d0ec17..b0cab94 100644
--- a/src/idle-parser.c
+++ b/src/idle-parser.c
@@ -519,8 +519,12 @@ static gboolean _parse_atom(IdleParser *parser, GValueArray *arr, char atom, con
gchar modechar = '\0';
/* Channel names can start with a '!', so don't strip that
- * (https://tools.ietf.org/html/rfc2811#section-3.2) */
- if (atom != 'r' && idle_muc_channel_is_modechar(token[0])) {
+ * (https://tools.ietf.org/html/rfc2811#section-3.2), not
+ * even when expecting a nickname (without mode chars) as
+ * that ends up for example messing up PRIMSG handling and
+ * showing the same message as both a channel and a private
+ * message */
+ if (atom == 'C' && idle_muc_channel_is_modechar(token[0])) {
modechar = token[0];
token++;
}