public void ReceiveMessage(CommunitySession session, Message message)
 {
     try
     {
         if (message.Type == MessageType.CommunityMessage)
         {
             CommunityMessage message2 = message as CommunityMessage;
             SessionTabItem   item     = this.FindIMSession(session);
             Buddy            sender   = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(message2.Uin, true);
             if ((sender != null) && (item != null))
             {
                 item.AddMsg(sender, message2.Time, message2.MessagePack);
             }
         }
         else if (message.Type == MessageType.InfoMessage)
         {
             InfoMessage    message3 = message as InfoMessage;
             SessionTabItem item2    = this.FindIMSession(session);
             if (item2 != null)
             {
                 item2.AddMsg(null, message3.Time, message3.MessagePack);
             }
         }
     }
     catch (Exception)
     {
     }
 }
Пример #2
0
        public void OnViewMessage(InstanceAnswerPro.Core.Message message)
        {
            InfoMessage message4;

            InstanceAnswerPro.Core.MessageType type = message.Type;
            if (type != InstanceAnswerPro.Core.MessageType.ContactMessage)
            {
                if (type != InstanceAnswerPro.Core.MessageType.CommunityMessage)
                {
                    if (type != InstanceAnswerPro.Core.MessageType.InfoMessage)
                    {
                        return;
                    }
                    goto Label_00B2;
                }
            }
            else
            {
                using (new Util_Perf.FunLog("ConversationModule.OnViewMessage  MessageType.ContactMessage"))
                {
                    ContactMessage message2 = message as ContactMessage;
                    if (!ContactSessionWindow.ActiveSessionWhenExist(message2.Uin, null))
                    {
                        this.CreateContactSessionWindow(message2.Uin);
                    }
                    return;
                }
            }
            using (new Util_Perf.FunLog("ConversationModule.OnViewMessage  MessageType.CommunityMessage"))
            {
                CommunityMessage message3 = message as CommunityMessage;
                if (!CommunitySessionWindow.ActiveSessionWhenExist(this._communitySessionManager.GetCommunitySession(message3.CommunityID, true)))
                {
                    this.CreateCommunitySessionWindow(message3.CommunityID);
                }
                return;
            }
Label_00B2:
            message4 = message as InfoMessage;
            if (message4.IsCommunityMsg)
            {
                if (!CommunitySessionWindow.ActiveSessionWhenExist(this._communitySessionManager.GetCommunitySession(message4.Uin, true)))
                {
                    this.CreateCommunitySessionWindow(message4.Uin);
                }
            }
            else if (!ContactSessionWindow.ActiveSessionWhenExist(message4.Uin, null))
            {
                this.CreateContactSessionWindow(message4.Uin);
            }
        }
Пример #3
0
 public void ReceiveMessage(CommunityMessage communityMessage)
 {
     try
     {
         InstanceAnswerPro.Core.Buddy sender = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(communityMessage.Uin, true);
         if (sender != null)
         {
             this.AddMsg(sender, communityMessage.Time, communityMessage.MessagePack);
         }
     }
     catch (Exception)
     {
     }
 }
Пример #4
0
 public void OnMessagePushed(InstanceAnswerPro.Core.Message message)
 {
     if (message.Type == InstanceAnswerPro.Core.MessageType.InfoMessage)
     {
         InfoMessage infoMessage = (InfoMessage)message;
         if (!infoMessage.IsCommunityMsg)
         {
             ContactSession contactSession = this._contactSessionManager.GetContactSession(infoMessage.Uin, false);
             if (contactSession != null)
             {
                 contactSession.OnMessageReceived(infoMessage);
                 this._messageCenter.PopMessage(infoMessage);
             }
         }
         else
         {
             CommunitySession communitySession = this._communitySessionManager.GetCommunitySession(infoMessage.Uin, false);
             if (communitySession != null)
             {
                 communitySession.OnMessageReceived(infoMessage);
                 this._messageCenter.PopMessage(infoMessage);
             }
         }
     }
     else if (message.Type == InstanceAnswerPro.Core.MessageType.ContactMessage)
     {
         ContactMessage message3 = (ContactMessage)message;
         this._messageCenter.NotifyMessage(new UICommandMessage("AddRecentContact", InstanceAnswerPro.Core.MessageType.ContactMessage, message3.Uin));
     }
     else if (message.Type == InstanceAnswerPro.Core.MessageType.CommunityMessage)
     {
         CommunityMessage message4 = (CommunityMessage)message;
         this._messageCenter.NotifyMessage(new UICommandMessage("AddRecentContact", InstanceAnswerPro.Core.MessageType.CommunityMessage, message4.CommunityID));
         this.CalculateUnreadCommunityMessageCount(message4);
     }
 }
Пример #5
0
 public void ReceiveMessage(CommunityMessage communityMessage)
 {
     try
     {
         InstanceAnswerPro.Core.Buddy sender = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(communityMessage.Uin, true);
         if (sender != null)
         {
             this.AddMsg(sender, communityMessage.Time, communityMessage.MessagePack);
         }
     }
     catch (Exception)
     {
     }
 }