[Telepathy-commits] [telepathy-gabble/master] Change MUC SelfHandle when appending _ to avoid conflicts.

Will Thompson will.thompson at collabora.co.uk
Sun Feb 1 07:30:54 PST 2009


The channel didn't its group mixin that the handle had changed when it appended
underscores. This led to a serious identity crisis.
---
 src/muc-channel.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/muc-channel.c b/src/muc-channel.c
index f82c7d7..bf3b1a3 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -1464,8 +1464,18 @@ _gabble_muc_channel_presence_error (GabbleMucChannel *chan,
         case XMPP_ERROR_CONFLICT:
           if (priv->nick_retry_count < MAX_NICK_RETRIES)
             {
+              TpHandleRepoIface *contact_repo;
+              TpHandle self_handle;
+
               g_string_append_c (priv->self_jid, '_');
 
+              contact_repo = tp_base_connection_get_handles (
+                  (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+              self_handle = tp_handle_ensure (contact_repo, priv->self_jid->str,
+                  GUINT_TO_POINTER (GABBLE_JID_ROOM_MEMBER), NULL);
+              tp_group_mixin_change_self_handle ((GObject *) chan, self_handle);
+              tp_handle_unref (contact_repo, self_handle);
+
               if (send_join_request (chan, priv->password, &tp_error))
                 {
                   priv->nick_retry_count++;
-- 
1.5.6.5




More information about the Telepathy-commits mailing list