public virtual MessageThreadsView GetMessageThread(int conversationId, int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending, ref int totalRecords)
        {
            var messageThreadsView = new MessageThreadsView();

            var dr = _dataService.GetMessageThread(conversationId, userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, ref totalRecords);

            try
            {
                while (dr.Read())
                {
                    var messageThreadView = new MessageThreadView {
                        Conversation = new MessageConversationView()
                    };
                    messageThreadView.Conversation.Fill(dr);

                    if (messageThreadView.Conversation.AttachmentCount > 0)
                    {
                        messageThreadView.Attachments = _dataService.GetMessageAttachmentsByMessage(messageThreadView.Conversation.MessageID);
                    }

                    if (messageThreadsView.Conversations == null)
                    {
                        messageThreadsView.Conversations = new List <MessageThreadView>();
                    }

                    messageThreadsView.Conversations.Add(messageThreadView);
                }
            }
            finally
            {
                CBO.CloseDataReader(dr, true);
            }

            return(messageThreadsView);
        }
Ejemplo n.º 2
0
        // Token: 0x06001065 RID: 4197 RVA: 0x000144C0 File Offset: 0x000126C0
        public static void Serialize(Stream stream, MessageThreadView instance)
        {
            int num = 0;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                BooleanProxy.Serialize(memoryStream, instance.HasNewMessages);
                if (instance.LastMessagePreview != null)
                {
                    StringProxy.Serialize(memoryStream, instance.LastMessagePreview);
                }
                else
                {
                    num |= 1;
                }
                DateTimeProxy.Serialize(memoryStream, instance.LastUpdate);
                Int32Proxy.Serialize(memoryStream, instance.MessageCount);
                Int32Proxy.Serialize(memoryStream, instance.ThreadId);
                if (instance.ThreadName != null)
                {
                    StringProxy.Serialize(memoryStream, instance.ThreadName);
                }
                else
                {
                    num |= 2;
                }
                Int32Proxy.Serialize(stream, ~num);
                memoryStream.WriteTo(stream);
            }
        }
Ejemplo n.º 3
0
 // Token: 0x06000B7A RID: 2938 RVA: 0x0000907D File Offset: 0x0000727D
 internal void UpdateThread(MessageThreadView newThreadView)
 {
     if (newThreadView.MessageCount != this._threadView.MessageCount)
     {
         this._messagesLoaded = false;
     }
     this._threadView      = newThreadView;
     this.LastServerUpdate = this._threadView.LastUpdate;
 }
Ejemplo n.º 4
0
        // Token: 0x06001066 RID: 4198 RVA: 0x00014578 File Offset: 0x00012778
        public static MessageThreadView Deserialize(Stream bytes)
        {
            int num = Int32Proxy.Deserialize(bytes);
            MessageThreadView messageThreadView = new MessageThreadView();

            messageThreadView.HasNewMessages = BooleanProxy.Deserialize(bytes);
            if ((num & 1) != 0)
            {
                messageThreadView.LastMessagePreview = StringProxy.Deserialize(bytes);
            }
            messageThreadView.LastUpdate   = DateTimeProxy.Deserialize(bytes);
            messageThreadView.MessageCount = Int32Proxy.Deserialize(bytes);
            messageThreadView.ThreadId     = Int32Proxy.Deserialize(bytes);
            if ((num & 2) != 0)
            {
                messageThreadView.ThreadName = StringProxy.Deserialize(bytes);
            }
            return(messageThreadView);
        }
Ejemplo n.º 5
0
 // Token: 0x06000B66 RID: 2918 RVA: 0x00008F9D File Offset: 0x0000719D
 public InboxThread(MessageThreadView threadView)
 {
     this._threadView      = threadView;
     this._messages        = new SortedList <int, InboxMessage>(threadView.MessageCount, new InboxThread.MessageSorter());
     this.LastServerUpdate = this._threadView.LastUpdate;
 }