about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-05-23 00:55:30 +0100
committerJames Booth <boothj5@gmail.com>2014-05-23 00:55:30 +0100
commitb85fd5e78ceacc93241ae71096ba8ffb72937852 (patch)
treea70c1637bbf7311289add22ad603ea0f6f60a0cc /src/xmpp
parentff37b44a628c8e0fb32956963b3e5b712fe56114 (diff)
downloadprofani-tty-b85fd5e78ceacc93241ae71096ba8ffb72937852.tar.gz
Use account muc_nick when no nick for bookmark
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/bookmark.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c
index a252841d..01e86451 100644
--- a/src/xmpp/bookmark.c
+++ b/src/xmpp/bookmark.c
@@ -326,8 +326,10 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
 
                 ++autojoin_count;
 
+                char *account_name = jabber_get_account_name();
+                ProfAccount *account = accounts_get_account(account_name);
                 if (name == NULL) {
-                    name = my_jid->localpart;
+                    name = account->muc_nick;
                 }
 
                 log_debug("Autojoin %s with nick=%s", jid, name);
@@ -337,6 +339,7 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
                     muc_join_room(jid, name, password, TRUE);
                 }
                 jid_destroy(room_jid);
+                account_free(account);
             } else {
                 log_debug("Rejected autojoin %s (maximum has been reached)", jid);
             }