aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/conference.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r--protocols/jabber/conference.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c
index cc832659..3a6cff7c 100644
--- a/protocols/jabber/conference.c
+++ b/protocols/jabber/conference.c
@@ -27,7 +27,8 @@
static xt_status jabber_chat_join_failed(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
static xt_status jabber_chat_self_message(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
-struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password)
+struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password,
+ gboolean always_use_nicks)
{
struct jabber_chat *jc;
struct xt_node *node;
@@ -58,6 +59,10 @@ struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, c
return NULL;
}
+ if (always_use_nicks) {
+ jc->flags = JCFLAG_ALWAYS_USE_NICKS;
+ }
+
/* roomjid isn't normalized yet, and we need an original version
of the nick to send a proper presence update. */
jc->my_full_jid = roomjid;
@@ -94,7 +99,7 @@ struct groupchat *jabber_chat_with(struct im_connection *ic, char *who)
g_free(uuid);
g_free(cserv);
- c = jabber_chat_join(ic, rjid, jd->username, NULL);
+ c = jabber_chat_join(ic, rjid, jd->username, NULL, FALSE);
g_free(rjid);
if (c == NULL) {
return NULL;
@@ -340,6 +345,11 @@ void jabber_chat_pkt_presence(struct im_connection *ic, struct jabber_buddy *bud
if (s) {
*s = 0; /* Should NEVER be NULL, but who knows... */
}
+
+ if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) {
+ imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource);
+ }
+
imcb_chat_add_buddy(chat, bud->ext_jid);
if (s) {
*s = '/';