Exemple #1
0
        public void AddChatters(List <MemberObj> addedUserList)
        {
            List <MemberObj> joinedChatterList = ChatUtils.GetLoggedInMemberFromNodeTag(ChattersTree.Nodes);
            string           addlist           = ChatUtils.GetLoggedInMemberList(joinedChatterList);

            //추가한 사용자 리스트 기존 대화자에게 전송
            foreach (MemberObj memberObj in joinedChatterList)
            {
                connection.SendMsgNotifyAddedUsers(formKey, addlist, memberObj.Id);
            }

            //추가한 사용자 채팅창의 대화자 리스트에 추가
            foreach (MemberObj memberObj in addedUserList)
            {
                AddChatterToNode(memberObj);
            }

            //채팅창 폼키에 대화자리스트 반영
            string newFormKey = ChatUtils.GetFormKeyWithMultiUsersAdded(formKey, ConfigHelper.Id, addlist);

            ChatForms.UpdateFormKey(newFormKey, formKey);
        }
Exemple #2
0
        /// <param name="chatterList">채팅가능자 조합한 키값(myid/id/id/id..)</param>
        public ChatForm(MsgrConnection connection, MiscController miscCtrl, List <MemberObj> groupList)
        {
            try
            {
                InitializeComponent();
                this.connection = connection;
                this.miscCtrl   = miscCtrl;
                List <string> userList = new List <string>();
                foreach (MemberObj userObj in groupList)
                {
                    if (userObj.Status != MsgrUserStatus.LOGOUT)
                    {
                        userList.Add(userObj.Id);
                    }
                }
                formKey = ChatUtils.GetFormKey(userList, ConfigHelper.Id);
                Initialize();
                Logger.info(string.Format("채팅창생성 key[{0}]", formKey));

                foreach (MemberObj userObj in groupList)
                {
                    if (userObj.Status != MsgrUserStatus.LOGOUT)
                    {
                        SetChatterOnFormOpening(userObj);
                    }
                    else
                    {
                        PostCanNotJoinMessage(userObj.Name);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.error(ex.ToString());
                MessageBox.Show("화면 초기화중 오류가 발생했습니다.\n 담당자에게 문의하세요.", "초기화 오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
 private void ParseChatterQuitMsg(string[] _msg)
 {
     chatKey = ChatUtils.GetFormKey(_msg[1], ConfigHelper.Id);
     quitter = Members.GetByUserId(_msg[2]);
 }
Exemple #4
0
        /// <summary>
        /// ___________1:1창__________다자창_______
        ///
        /// on   | key(out->in)      key변경없음
        ///        노드상태변경      노드상태변경
        ///
        /// out  | key(in->out)      quit처리(**비정상종료로 quit없이 아웃됨)
        ///        노드상태변경
        ///        메시지display
        ///
        /// busy | key변경없음       key변경없음
        ///        노드상태변경      노드상태변경
        ///
        /// away |     동일
        ///
        /// dnd  |     동일
        ///
        /// </summary>
        /// <param name="id"></param>
        public void ChangeStatusOnChatterStatusReceived(object sender, CustomEventArgs e)
        {
            try {
                MemberObj memberObj = (MemberObj)e.GetItem;
                if (this.formKey.Contains(ConfigHelper.Id))
                {
                    switch (memberObj.Status)
                    {
                    case MsgrUserStatus.ONLINE:
                        //1:1채팅인 경우만
                        if (HasSingleChatter())
                        {
                            //1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserAdded(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //2.노드상태변경
                            //3.메시지디스플레이
                            SetChatterLogIn(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        else
                        {    //다자창
                            //1.키변경없음
                            //2.노드상태변경
                            SetChatterLogIn(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        break;

                    case MsgrUserStatus.LOGOUT:
                        //1:1채팅인 경우만
                        if (HasSingleChatter())
                        {
                            //1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserLogOut(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //2.노드상태변경
                            //3.메시지디스플레이
                            SetChatterLogOut(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        else
                        {    //다자창
                            //quit처리
                            //  1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserQuit(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //  2. 노드삭제
                            DeleteChatter(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        break;

                    case MsgrUserStatus.BUSY:
                    case MsgrUserStatus.AWAY:
                    case MsgrUserStatus.DND:
                        //노드상태변경
                        SetChatterStatus(memberObj.Id, Members.GetByUserId(memberObj.Id).Name, memberObj.Status);
                        break;
                    }
                }
            } catch (Exception exception) {
                Logger.error(exception.ToString());
            }
        }