[Telepathy-commits] [telepathy-idle/master] Fix Bug #19766: private messages no longer delivered to group chat
Jonathon Jongsma
jonathon.jongsma at collabora.co.uk
Fri Feb 13 17:43:18 PST 2009
This could perhaps be a slightly controversial change. The reason that the bug
happened was that telepathy-idle's room handle repository normalizer function
had some special code to make joining chatrooms more user-friendly. Basically,
if the user specified a chatroom 'foo', it would assume you meant '#foo' and
automatically prepend the '#' character.
The way the parser currently works is that when we get in a privmsg, we try to
parse the 'destination' of the privmsg as both a contact and a room. The way we
determine if it's a valid room or not is by calling tp_handle_ensure(room_repo,
...) (and same for determining valid contacts). Unfortunately, because of the
automatic #-prepending this means that a single privmsg destination can be both
a valid contact and a valid channel name, so if the user is in a channel with
the same name as their nick (but without the leading #), the privmsg will be
handled by both the IMFactory and the MUCFactory
---
src/idle-handles.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/src/idle-handles.c b/src/idle-handles.c
index 2dd9ea3..d89b32a 100644
--- a/src/idle-handles.c
+++ b/src/idle-handles.c
@@ -121,12 +121,6 @@ static gchar *_nick_normalize_func(TpHandleRepoIface *repo, const gchar *id, gpo
static gchar *_channel_normalize_func(TpHandleRepoIface *repo, const gchar *id, gpointer ctx, GError **error) {
gchar *channel = g_strdup(id);
- if ((channel[0] != '#') && (channel[0] != '!') && (channel[0] != '&') && (channel[0] != '+')) {
- gchar *tmp = channel;
- channel = g_strdup_printf("#%s", channel);
- g_free(tmp);
- }
-
if (!_channelname_is_valid(channel)) {
g_set_error(error, TP_ERRORS, TP_ERROR_INVALID_HANDLE, "invalid channel ID");
return NULL;
--
1.5.6.5
More information about the telepathy-commits
mailing list