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);
                }
            });
        }
Beispiel #2
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);
            }
        }