Ejemplo n.º 1
0
        public void Xmpp_OnMessage(object sender, MessageEventArgs e)
        {
            if (appPreferences.isFisrtAcess(AppPreferences.FIRST_ACCESS) == true)
            {
                return;
            }
            if (context.GetType() == typeof(SessionActivity))
            {
                SessionActivity session = (SessionActivity)context;
                session.Xmpp_OnMessage(session, e);
            }
            else if (context.GetType() == typeof(ChatActivity))
            {
                ChatActivity chat = (ChatActivity)context;
                chat.Xmpp_OnMessage(sender, e);
            }
            else if (context.GetType() == typeof(ContacPhoneActivity))
            {
                ContacPhoneActivity cp = (ContacPhoneActivity)context;
                cp.Xmpp_OnMessage(sender, e);
            }

            if (context.GetType() != typeof(ChatActivity))
            {
                BaseAppCompatActivity o = (BaseAppCompatActivity)context;
                o.CountMessage(sender, e);
            }
        }
Ejemplo n.º 2
0
        public void XmppClient_OnRosterItem(object sender, Matrix.Xmpp.Roster.RosterEventArgs e)
        {
            List <AppCore.User> uses = LegionUtils.getListJson(appPreferences.getValueKey(AppPreferences.CONTACTS));

            uses.Add(new AppCore.User(e.RosterItem.Jid.Bare, e.RosterItem.Jid.Bare.Split('@')[0]));
            LegionUtils.saveFoundContacts(uses, appPreferences, AppPreferences.CONTACTS);

            if (context.GetType() == typeof(ContacPhoneActivity))
            {
                ContacPhoneActivity cpa = (ContacPhoneActivity)context;
                cpa.XmppClient_OnRosterItem(sender, e);
            }
        }