Esempio 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);
            }
        }
Esempio n. 2
0
        public virtual void OnInvit(object sender, MessageEventArgs e)
        {
            RunOnUiThread(() =>
            {
                List <AppCore.User> groups = getGroupsTempToList(AppPreferences.GROUPS_TEMP);
                string invitFrom           = e.From;
                string managerGroup        = e.Body;

                AppCore.User g = new AppCore.User();
                g.Jid          = invitFrom;
                g.username     = invitFrom;
                g.isGroup      = true;
                groups.Add(g);

                //JoinOnGroup(invitFrom);

                int index = groups.FindIndex(c => c.Jid.Split('@')[0].Equals(e.From.Split('@')[0]));
                groups    = userService.moveItemToFirst(groups, index);
                setLastMsgInPhone(groups, 0, "@Joined the Group");
                saveSeachGroups(groups);

                if (this.GetType() == typeof(SessionActivity))
                {
                    SessionActivity s = (SessionActivity)this;
                    s.updateUIListGroupsUsers(groups);
                }
            });
        }
Esempio n. 3
0
 public void Xmpp_OnInvit(object sender, MessageEventArgs e)
 {
     if (context.GetType() == typeof(SessionActivity))
     {
         SessionActivity o = (SessionActivity)context;
         o.OnInvit(sender, e);
     }
     else
     {
         BaseAppCompatActivity o = (BaseAppCompatActivity)context;
         o.OnInvit(sender, e);
     }
 }
Esempio n. 4
0
        public void setNameFromGroup(string groupName, string From)
        {
            List <AppCore.User> groups = LegionUtils.getGroupsTempToList(AppPreferences.GROUPS_TEMP, appPreferences);
            var index = groups.FindIndex(c => c.Jid.Split('@')[0] == From.Split('@')[0]);

            groups[index].username = groupName;
            groups[index].Nick     = groupName;

            LegionUtils.saveFoundGroups(groups, appPreferences, AppPreferences.GROUPS_TEMP);

            if (context.GetType() == typeof(SessionActivity))
            {
                SessionActivity o = (SessionActivity)context;
                o.updateUIListGroupsUsers(groups);
            }
        }