From 2fe8489d368a371aefbfbe66e74621a8df14cdc2 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 10 Mar 2017 17:01:45 +0100 Subject: Rename vala-xmpp library to xmpp-vala --- vala-xmpp/src/module/xep/0045_muc/flag.vala | 80 ----------------------------- 1 file changed, 80 deletions(-) delete mode 100644 vala-xmpp/src/module/xep/0045_muc/flag.vala (limited to 'vala-xmpp/src/module/xep/0045_muc/flag.vala') diff --git a/vala-xmpp/src/module/xep/0045_muc/flag.vala b/vala-xmpp/src/module/xep/0045_muc/flag.vala deleted file mode 100644 index 6c1ef508..00000000 --- a/vala-xmpp/src/module/xep/0045_muc/flag.vala +++ /dev/null @@ -1,80 +0,0 @@ -using Gee; - -using Xmpp.Core; - -namespace Xmpp.Xep.Muc { - -public class Flag : XmppStreamFlag { - public const string ID = "muc"; - - private HashMap enter_listeners = new HashMap(); - private HashMap enter_ids = new HashMap(); - private HashMap own_nicks = new HashMap(); - private HashMap subjects = new HashMap(); - private HashMap subjects_by = new HashMap(); - private HashMap occupant_real_jids = new HashMap(); - private HashMap occupant_affiliation = new HashMap(); - private HashMap occupant_role = new HashMap(); - - public string? get_real_jid(string full_jid) { return occupant_real_jids[full_jid]; } - - public void set_real_jid(string full_jid, string real_jid) { occupant_real_jids[full_jid] = real_jid; } - - public string? get_occupant_affiliation(string full_jid) { return occupant_affiliation[full_jid]; } - - public void set_occupant_affiliation(string full_jid, string affiliation) { occupant_affiliation[full_jid] = affiliation; } - - public string? get_occupant_role(string full_jid) { return occupant_role[full_jid]; } - - public void set_occupant_role(string full_jid, string role) { occupant_role[full_jid] = role; } - - public string? get_muc_nick(string bare_jid) { return own_nicks[bare_jid]; } - - public string? get_enter_id(string bare_jid) { return enter_ids[bare_jid]; } - - public MucEnterListener? get_enter_listener(string bare_jid) { return enter_listeners[bare_jid]; } - - public bool is_muc(string jid) { return own_nicks[jid] != null; } - - public bool is_occupant(string jid) { - string bare_jid = get_bare_jid(jid); - return own_nicks.has_key(bare_jid) || enter_ids.has_key(bare_jid); - } - - public bool is_muc_enter_outstanding() { return enter_ids.size != 0; } - - public string? get_muc_subject(string bare_jid) { return subjects[bare_jid]; } - - public void set_muc_subject(string full_jid, string subject) { - string bare_jid = get_bare_jid(full_jid); - subjects[bare_jid] = subject; - subjects_by[bare_jid] = full_jid; - } - - public void start_muc_enter(string bare_jid, string presence_id, MucEnterListener listener) { - enter_listeners[bare_jid] = listener; - enter_ids[bare_jid] = presence_id; - } - - public void finish_muc_enter(string bare_jid, string? nick = null) { - if (nick != null) own_nicks[bare_jid] = nick; - enter_listeners.unset(bare_jid); - enter_ids.unset(bare_jid); - } - - public void remove_occupant_info(string full_jid) { - occupant_real_jids.unset(full_jid); - occupant_affiliation.unset(full_jid); - occupant_role.unset(full_jid); - } - - public static Flag? get_flag(XmppStream stream) { return (Flag?) stream.get_flag(NS_URI, ID); } - - public static bool has_flag(XmppStream stream) { return get_flag(stream) != null; } - - public override string get_ns() { return NS_URI; } - - public override string get_id() { return ID; } -} - -} \ No newline at end of file -- cgit v1.2.3