diff options
author | Marius Halden <marius.h@lden.org> | 2016-10-17 09:37:20 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2016-10-17 09:37:20 +0200 |
commit | bfce290626ae7b771f8dafdc1e0c77279ce16fc8 (patch) | |
tree | 575fa544231b6ae925fc377ccccc5edf04b7a126 /protocols/jabber/jabber.c | |
parent | 305a1ddb6c5b03615f98ad45e80ee3d7a5387a3a (diff) | |
parent | f95e606e153c785dab62a2ac4eab1bc34d41e50a (diff) |
Merge branch 'master' into patched-master
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 05bd9cf9..73bc77ea 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -323,6 +323,8 @@ static void jabber_logout(struct im_connection *ic) { struct jabber_data *jd = ic->proto_data; + imcb_chat_list_free(ic); + while (jd->filetransfers) { imcb_file_canceled(ic, (( struct jabber_transfer *) jd->filetransfers->data)->ft, "Logging out"); } @@ -598,6 +600,21 @@ static struct groupchat *jabber_chat_with_(struct im_connection *ic, char *who) return jabber_chat_with(ic, who); } +static void jabber_chat_list_(struct im_connection *ic, const char *server) +{ + struct jabber_data *jd = ic->proto_data; + + if (server && *server) { + jabber_iq_disco_muc(ic, server); + } else if (jd->muc_host && *jd->muc_host) { + jabber_iq_disco_muc(ic, jd->muc_host); + } else { + /* throw an error here, don't query conference.[server] directly. + * for things like jabber.org it gets you 18000 results of garbage */ + imcb_error(ic, "Please specify a server name such as `conference.%s'", jd->server); + } +} + static void jabber_chat_msg_(struct groupchat *c, char *message, int flags) { if (c && message) { @@ -773,6 +790,7 @@ void jabber_initmodule() ret->chat_leave = jabber_chat_leave_; ret->chat_join = jabber_chat_join_; ret->chat_with = jabber_chat_with_; + ret->chat_list = jabber_chat_list_; ret->chat_add_settings = jabber_chat_add_settings; ret->chat_free_settings = jabber_chat_free_settings; ret->keepalive = jabber_keepalive; |