From 4247922e8cc85b488997ebef2121e6f3055e1e26 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 18 May 2017 23:14:44 +0200 Subject: Member affiliation in occupant list --- libdino/src/service/muc_manager.vala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libdino') 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? get_offline_members(Jid jid, Account account) { + Gee.List ret = new ArrayList(Jid.equals_func); + Core.XmppStream? stream = stream_interactor.get_stream(account); + if (stream != null) { + Gee.List? 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); -- cgit v1.2.3-70-g09d2