diff options
author | eerielili <lionel@les-miquelots.net> | 2024-08-25 13:32:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-25 13:32:38 +0000 |
commit | 45755727db79a2935376d24e7bde7eadb0f2f7ca (patch) | |
tree | 73715da99c9d980079df6f2d561822364655e04d /libdino/src/service/muc_manager.vala | |
parent | 62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff) | |
parent | 51252f74c94c17d56aa75534652bdc5d43a504cb (diff) | |
download | dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip |
Merge branch 'master' into add-yourselfadd-yourself
Diffstat (limited to 'libdino/src/service/muc_manager.vala')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 119079f0..111ace22 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -84,11 +84,6 @@ public class MucManager : StreamInteractionModule, Object { } mucs_joining[account].add(jid); - if (!mucs_todo.has_key(account)) { - mucs_todo[account] = new HashSet<Jid>(Jid.hash_bare_func, Jid.equals_bare_func); - } - mucs_todo[account].add(jid.with_resource(nick_)); - Muc.JoinResult? res = yield stream.get_module(Xep.Muc.Module.IDENTITY).enter(stream, jid.bare_jid, nick_, password, history_since, receive_history, null); mucs_joining[account].remove(jid); @@ -127,6 +122,11 @@ public class MucManager : StreamInteractionModule, Object { enter_errors[jid] = res.muc_error; } + if (!mucs_todo.has_key(account)) { + mucs_todo[account] = new HashSet<Jid>(Jid.hash_bare_func, Jid.equals_bare_func); + } + mucs_todo[account].add(jid.with_resource(res.nick ?? nick_)); + return res; } @@ -232,15 +232,8 @@ public class MucManager : StreamInteractionModule, Object { //the term `private room` is a short hand for members-only+non-anonymous rooms public bool is_private_room(Account account, Jid jid) { - XmppStream? stream = stream_interactor.get_stream(account); - if (stream == null) { - return false; - } - Xep.Muc.Flag? flag = stream.get_flag(Xep.Muc.Flag.IDENTITY); - if (flag == null) { - return false; - } - return flag.has_room_feature(jid, Xep.Muc.Feature.NON_ANONYMOUS) && flag.has_room_feature(jid, Xep.Muc.Feature.MEMBERS_ONLY); + var entity_info = stream_interactor.get_module(EntityInfo.IDENTITY); + return entity_info.has_feature_offline(account, jid, "muc_membersonly") && entity_info.has_feature_offline(account, jid, "muc_nonanonymous"); } public bool is_moderated_room(Account account, Jid jid) { |