Esempio n. 1
0
        public ChatSession GetChatSession(int operatorID, int targetUserID)
        {
            if (operatorID <= 0)
            {
                ThrowError(new NotLoginError());
                return(null);
            }

            if (targetUserID <= 0)
            {
                return(null);
            }
#if !Passport
            PassportClientConfig settings = Globals.PassportClient;
            if (settings.EnablePassport)
            {
                ChatSessionProxy session = settings.PassportService.Chat_GetChatSessionByUserID(operatorID, targetUserID);


                return(GetChatSession(session));
            }
            else
#endif
            {
                return(ChatDao.Instance.GetChatSession(operatorID, targetUserID));
            }
        }
Esempio n. 2
0
        public static ChatSessionProxy GetChatSessionProxy(ChatSession session)
        {
            if (session == null)
            {
                return(null);
            }
            ChatSessionProxy proxy = new ChatSessionProxy();

            proxy.ChatSessionID  = session.ChatSessionID;
            proxy.CreateDate     = session.CreateDate;
            proxy.LastMessage    = session.LastMessage;
            proxy.OwnerID        = session.OwnerID;
            proxy.TotalMessages  = session.TotalMessages;
            proxy.UnreadMessages = session.UnreadMessages;
            proxy.UpdateDate     = session.UpdateDate;
            proxy.UserID         = session.UserID;

            return(proxy);
        }