[telepathy-idle-0.2] telepathy-idle: Handle modechars properly

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Oct 31 23:01:10 UTC 2020


Module: telepathy-idle
Branch: telepathy-idle-0.2
Commit: 71ea7e98a1e68c5a51b0a36e662a95d07a04a3d7
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=71ea7e98a1e68c5a51b0a36e662a95d07a04a3d7

Author: Daniel Landau <daniel at landau.fi>
Date:   Wed Nov  9 21:27:11 2016 +0200

Handle modechars properly

Never strip out modechars unless we are explicitly trying to parse
a nickname with modechars, i.e., atom 'C'

---

 src/idle-parser.c | 8 ++++++--
 1 file 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++;
 			}



More information about the telepathy-commits mailing list