diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-02-01 15:52:17 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-02-01 19:42:34 +0000 |
commit | 03b3f3f7ea0a4718b0cf2ff454baec1c6d5da56b (patch) | |
tree | ee71da4d94c379a3764b437ea7cef00ee0cae98c /src/muc-channel.c | |
parent | 422a56ad7b2bc1806187316af157e1ded20f50e6 (diff) | |
download | telepathy-gabble-03b3f3f7ea0a4718b0cf2ff454baec1c6d5da56b.tar.gz |
Update MUC members when renaming to avoid nick conflict.
Diffstat (limited to 'src/muc-channel.c')
-rw-r--r-- | src/muc-channel.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index bf3b1a3b2..84857b426 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -1464,16 +1464,32 @@ _gabble_muc_channel_presence_error (GabbleMucChannel *chan, case XMPP_ERROR_CONFLICT: if (priv->nick_retry_count < MAX_NICK_RETRIES) { + TpGroupMixin *mixin = TP_GROUP_MIXIN (chan); TpHandleRepoIface *contact_repo; TpHandle self_handle; + TpIntSet *add_rp = tp_intset_sized_new (1); + TpIntSet *remove_rp = tp_intset_sized_new (1); + /* Add a _ to our jid, and update the group mixin's self handle + * and remote pending members appropriately. + */ 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_intset_add (add_rp, self_handle); + tp_intset_add (remove_rp, mixin->self_handle); + tp_group_mixin_change_self_handle ((GObject *) chan, self_handle); + tp_group_mixin_change_members ((GObject *) chan, NULL, NULL, + remove_rp, NULL, add_rp, 0, + TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED); + + tp_intset_destroy (add_rp); + tp_intset_destroy (remove_rp); tp_handle_unref (contact_repo, self_handle); if (send_join_request (chan, priv->password, &tp_error)) |