[Telepathy-commits] [telepathy-gabble/master] build MUC self_jid with the alias for our self_handle, not just the local part of the JID (note it's guaranteed not to be NULL, as _get_cached_alias falls back to the local part of the JID anyway)
Robert McQueen
robert.mcqueen at collabora.co.uk
Tue Aug 19 10:54:03 PDT 2008
20080727003241-418b8-2fd067153296de634c2e929f8adcaec85e7026fa.gz
---
src/muc-channel.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/muc-channel.c b/src/muc-channel.c
index 97e1b41..1213b2d 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -37,6 +37,7 @@
#define DEBUG_FLAG GABBLE_DEBUG_MUC
#include "connection.h"
+#include "conn-aliasing.h"
#include "debug.h"
#include "disco.h"
#include "error.h"
@@ -656,8 +657,7 @@ create_room_identity (GabbleMucChannel *chan,
GabbleMucChannelPrivate *priv;
TpBaseConnection *conn;
TpHandleRepoIface *contact_repo;
- const gchar *main_jid;
- gchar *username, *jid;
+ gchar *alias = NULL;
priv = GABBLE_MUC_CHANNEL_GET_PRIVATE (chan);
conn = (TpBaseConnection *) priv->conn;
@@ -665,23 +665,20 @@ create_room_identity (GabbleMucChannel *chan,
g_assert (priv->self_jid == NULL);
- main_jid = tp_handle_inspect (contact_repo, conn->self_handle);
+ _gabble_connection_get_cached_alias (priv->conn, conn->self_handle, &alias);
+ g_assert (alias != NULL);
- gabble_decode_jid (main_jid, &username, NULL, NULL);
+ priv->self_jid = g_string_new (priv->jid);
+ g_string_append_c (priv->self_jid, '/');
+ g_string_append (priv->self_jid, alias);
- jid = g_strdup_printf ("%s/%s", priv->jid, username);
-
- g_free (username);
+ g_free (alias);
if (room_handle)
{
- *room_handle = tp_handle_ensure (contact_repo, jid,
+ *room_handle = tp_handle_ensure (contact_repo, priv->self_jid->str,
GUINT_TO_POINTER (GABBLE_JID_ROOM_MEMBER), NULL);
}
-
- priv->self_jid = g_string_new (jid);
-
- g_free (jid);
}
static LmMessage *
--
1.5.6.3
More information about the Telepathy-commits
mailing list