diff options
author | fiaxh <git@mx.ax.lt> | 2017-05-18 23:14:44 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-05-18 23:14:44 +0200 |
commit | 4247922e8cc85b488997ebef2121e6f3055e1e26 (patch) | |
tree | cf0837eb98a5e0dedf9deaa2fe8ba480c7098f0f /libdino | |
parent | b09a056a13de131a4f2f072ffa2f795a0bb2abe7 (diff) | |
download | dino-4247922e8cc85b488997ebef2121e6f3055e1e26.tar.gz dino-4247922e8cc85b488997ebef2121e6f3055e1e26.zip |
Member affiliation in occupant list
Diffstat (limited to 'libdino')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 17870b19..bf9b4cda 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -132,6 +132,27 @@ public class MucManager : StreamInteractionModule, Object { return null; } + public Xep.Muc.Affiliation? get_affiliation(Jid muc_jid, Jid jid, Account account) { + Core.XmppStream? stream = stream_interactor.get_stream(account); + if (stream != null) { + return stream.get_flag(Xep.Muc.Flag.IDENTITY).get_affiliation(muc_jid.to_string(), jid.to_string()); + } + return null; + } + + public Gee.List<Jid>? get_offline_members(Jid jid, Account account) { + Gee.List<Jid> ret = new ArrayList<Jid>(Jid.equals_func); + Core.XmppStream? stream = stream_interactor.get_stream(account); + if (stream != null) { + Gee.List<string>? members = stream.get_flag(Xep.Muc.Flag.IDENTITY).get_offline_members(jid.to_string()); + if (members == null) return null; + foreach (string member in members) { + ret.add(new Jid(member)); + } + } + return ret; + } + public Jid? get_message_real_jid(Entities.Message message) { if (message.real_jid != null) { return new Jid(message.real_jid); |