aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2018-01-16 16:16:43 +0100
committerfiaxh <git@mx.ax.lt>2018-01-28 00:38:47 +0100
commit03a349bfafe7e65abdbb692707e3361a9fdc57f4 (patch)
tree7866a1ef708bd253ec02138f0ff8da59469d17f3
parentbbfac9115500405095210f046dbccef913d03e04 (diff)
downloaddino-03a349bfafe7e65abdbb692707e3361a9fdc57f4.tar.gz
dino-03a349bfafe7e65abdbb692707e3361a9fdc57f4.zip
Small fixes to MucManager
-rw-r--r--libdino/src/service/muc_manager.vala13
-rw-r--r--xmpp-vala/src/module/xep/0048_bookmarks/conference.vala2
2 files changed, 10 insertions, 5 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index 23c234a4..3b452f20 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -105,7 +105,10 @@ public class MucManager : StreamInteractionModule, Object {
Gee.List<Jid>? occupants = get_occupants(jid, account);
Jid? own_jid = get_own_jid(jid, account);
if (occupants != null && own_jid != null) {
- occupants.remove(own_jid);
+ Gee.List<Jid> occupants_ = new ArrayList<Jid>(Jid.equals_func);
+ occupants_.add_all(occupants);
+ occupants_.remove(own_jid);
+ return occupants_;
}
return occupants;
}
@@ -309,7 +312,8 @@ public class MucManager : StreamInteractionModule, Object {
foreach (Xep.Bookmarks.Conference conference in conferences) {
if (conference.jid.equals_bare(jid) && conference.nick == nick && conference.password == password) {
if (!conference.autojoin) {
- stream.get_module(Xep.Bookmarks.Module.IDENTITY).replace_conference(stream, conference, changed);
+ conference.autojoin = true;
+ stream.get_module(Xep.Bookmarks.Module.IDENTITY).set_conferences(stream, conferences);
}
return;
}
@@ -324,8 +328,9 @@ public class MucManager : StreamInteractionModule, Object {
foreach (Xep.Bookmarks.Conference conference in conferences) {
if (conference.jid.equals_bare(jid)) {
if (conference.autojoin) {
- Xep.Bookmarks.Conference change = new Xep.Bookmarks.Conference(conference.jid) { nick=conference.nick, password=conference.password, autojoin=false };
- stream.get_module(Xep.Bookmarks.Module.IDENTITY).replace_conference(stream, conference, change);
+ conference.autojoin = false;
+ stream.get_module(Xep.Bookmarks.Module.IDENTITY).set_conferences(stream, conferences);
+ return;
}
}
}
diff --git a/xmpp-vala/src/module/xep/0048_bookmarks/conference.vala b/xmpp-vala/src/module/xep/0048_bookmarks/conference.vala
index e5037e42..c00d8f86 100644
--- a/xmpp-vala/src/module/xep/0048_bookmarks/conference.vala
+++ b/xmpp-vala/src/module/xep/0048_bookmarks/conference.vala
@@ -14,7 +14,7 @@ public class Conference : Object {
public bool autojoin {
get {
string? attr = stanza_node.get_attribute(ATTRIBUTE_AUTOJOIN);
- return attr == "true" || attr == "1"; // "1" isn't standard, but it's used
+ return attr == "true" || attr == "1";
}
set { stanza_node.set_attribute(ATTRIBUTE_AUTOJOIN, value.to_string()); }
}