Esempio n. 1
0
        private void ProcAddUsers(ChatRoomInfo obj)
        {
            foreach (string name in obj.body.users)
            {
                if (mUsers.ContainsKey(name))
                {
                    continue;
                }

                mUsers[name] = mMessages.Count;
            }

            DatabaseMgr.AddChatUsers(obj);
            BroadcastRoomInfo(GetRoomInfo());
        }
Esempio n. 2
0
        private void AddUsers(ChatRoomInfo obj)
        {
            if (obj.body.users == null)
            {
                return;
            }

            foreach (string name in obj.body.users)
            {
                if (mUsers.ContainsKey(name))
                {
                    continue;
                }

                mUsers[name] = mMessages.Count;
            }

            DatabaseMgr.AddChatUsers(obj);
        }
Esempio n. 3
0
        public int CreateNewChat(ChatRoomInfo obj)
        {
            DataRow row = DatabaseMgr.PushNewChat(obj);

            mRoomID = (int)row["recordID"];
            mAccess = obj.body.access;
            mMessages.Clear();
            obj.body.recordID = mRoomID;

            if (obj.body.users != null)
            {
                foreach (var user in obj.body.users)
                {
                    mUsers[user] = 0;
                }
            }

            AddTask(obj);

            DatabaseMgr.AddChatUsers(obj);
            //BroadcastRoomInfo( GetRoomInfo() );

            return(mRoomID);
        }