aboutsummaryrefslogtreecommitdiff
path: root/libdino/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-11-17 17:53:46 +0100
committerfiaxh <git@lightrise.org>2019-11-17 17:53:46 +0100
commit05561dd677b4098d1a618bcc3e01fc77c5ce19de (patch)
treef25ea04f3e7ef40211c161af366244efc2c206a5 /libdino/src
parenta2f63a7789aca9e05e5dfd1a9c2838e31aefe60d (diff)
downloaddino-05561dd677b4098d1a618bcc3e01fc77c5ce19de.tar.gz
dino-05561dd677b4098d1a618bcc3e01fc77c5ce19de.zip
Parse presence delivery errors when joining MUC
fixes #224
Diffstat (limited to 'libdino/src')
-rw-r--r--libdino/src/service/muc_manager.vala11
1 files changed, 6 insertions, 5 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index 2c4512e6..fa76ddd5 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -1,6 +1,7 @@
using Gee;
using Xmpp;
+using Xmpp.Xep;
using Dino.Entities;
namespace Dino {
@@ -36,9 +37,9 @@ public class MucManager : StreamInteractionModule, Object {
stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(received_message_listener);
}
- public void join(Account account, Jid jid, string? nick, string? password) {
+ public async Muc.JoinResult? join(Account account, Jid jid, string? nick, string? password) {
XmppStream? stream = stream_interactor.get_stream(account);
- if (stream == null) return;
+ if (stream == null) return null;
string nick_ = nick ?? account.bare_jid.localpart ?? account.bare_jid.domainpart;
DateTime? history_since = null;
@@ -48,7 +49,7 @@ public class MucManager : StreamInteractionModule, Object {
if (last_message != null) history_since = last_message.time;
}
- stream.get_module(Xep.Muc.Module.IDENTITY).enter(stream, jid.bare_jid, nick_, password, history_since);
+ return yield stream.get_module(Xep.Muc.Module.IDENTITY).enter(stream, jid.bare_jid, nick_, password, history_since);
}
public void part(Account account, Jid jid) {
@@ -323,7 +324,7 @@ public class MucManager : StreamInteractionModule, Object {
Gee.List<Conversation> conversations = stream_interactor.get_module(ConversationManager.IDENTITY).get_active_conversations(account);
foreach (Conversation conversation in conversations) {
if (conversation.type_ == Conversation.Type.GROUPCHAT && conversation.nickname != null) {
- join(account, conversation.counterpart, conversation.nickname, null);
+ join.begin(account, conversation.counterpart, conversation.nickname, null);
}
}
}
@@ -345,7 +346,7 @@ public class MucManager : StreamInteractionModule, Object {
if (conference.jid.equals(conversation.counterpart)) is_active = true;
}
if (!is_active || !is_joined(jid, account)) {
- join(account, conference.jid, conference.nick, conference.password);
+ join.begin(account, conference.jid, conference.nick, conference.password);
}
} else {
// Leave if we should leave