// Token: 0x06000B0A RID: 2826 RVA: 0x000471CC File Offset: 0x000453CC
    public void SendPrivateMessage(int cmidId, string name, string rawMessage)
    {
        string text = TextUtilities.ShortenText(TextUtilities.Trim(rawMessage), 140, false);

        if (!string.IsNullOrEmpty(text))
        {
            if (!this._allThreads.ContainsKey(cmidId))
            {
                InboxThread inboxThread = new InboxThread(new MessageThreadView
                {
                    HasNewMessages     = false,
                    ThreadName         = name,
                    LastMessagePreview = string.Empty,
                    ThreadId           = cmidId,
                    LastUpdate         = DateTime.Now,
                    MessageCount       = 0
                });
                this._allThreads.Add(inboxThread.ThreadId, inboxThread);
                this._sortedAllThreads.Add(inboxThread);
            }
            PrivateMessageWebServiceClient.SendMessage(PlayerDataManager.AuthToken, cmidId, text, delegate(PrivateMessageView pm)
            {
                this.OnPrivateMessageSent(cmidId, pm);
            }, delegate(Exception ex)
            {
            });
        }
    }
    // Token: 0x06000B5A RID: 2906 RVA: 0x00048508 File Offset: 0x00046708
    private void DoMessages(Rect rect)
    {
        InboxThread inboxThread = InboxThread.Current;
        bool        flag        = inboxThread != null && inboxThread.IsAdmin;
        Rect        position    = new Rect(rect.x + 8f, rect.y + 2f, rect.width - 16f, rect.height - 8f);

        GUI.Box(position, GUIContent.none, BlueStonez.box_grey50);
        string text = LocalizedStrings.NoConversationSelected;

        if (inboxThread != null)
        {
            text = string.Format(LocalizedStrings.BetweenYouAndN, inboxThread.Name);
            if (GUI.Button(new Rect(position.x + 10f, position.y + 10f, 150f, 20f), "Delete Conversation", BlueStonez.buttondark_medium))
            {
                InboxThread.Current = null;
                Singleton <InboxManager> .Instance.DeleteThread(inboxThread.ThreadId);
            }
        }
        GUI.contentColor = new Color(1f, 1f, 1f, 0.75f);
        GUI.Label(new Rect(position.x + 10f, position.y, position.width - 20f, 40f), text, BlueStonez.label_interparkmed_11pt_right);
        GUI.contentColor = Color.white;
        GUI.Label(new Rect(position.x + 4f, position.y + 40f, position.width - 8f, 1f), GUIContent.none, BlueStonez.horizontal_line_grey95);
        int  num       = 8;
        Rect position2 = new Rect(position.x + 8f, position.y + 48f, position.width - 8f, position.height - (float)((!flag) ? 90 : 49));

        if (InboxThread.Current != null)
        {
            inboxThread.Scroll = GUITools.BeginScrollView(position2, inboxThread.Scroll, new Rect(0f, 0f, (float)this._messageViewWidth, (float)this._messageViewHeight), false, false, true);
            num = inboxThread.DrawMessageList(num, this._messageViewWidth, position2.height, inboxThread.Scroll.y);
            if ((float)num > position2.height)
            {
                this._messageViewHeight = num;
                this._messageViewWidth  = (int)(position2.width - 22f);
            }
            else
            {
                this._messageViewHeight = (int)position2.height;
                this._messageViewWidth  = (int)position2.width - 8;
            }
            GUITools.EndScrollView();
        }
        else
        {
            GUI.Label(position2, "Select a message thread", BlueStonez.label_interparkbold_13pt);
        }
        if (!flag)
        {
            GUITools.PushGUIState();
            GUI.enabled &= (InboxThread.Current != null);
            GUI.Box(new Rect(rect.x + 8f, rect.y + rect.height - 51f, rect.width - 16f, 45f), GUIContent.none, BlueStonez.window_standard_grey38);
            this.DoReply(new Rect(rect.x, rect.y + rect.height - 51f, rect.width, 45f));
            GUITools.PopGUIState();
        }
    }
 // Token: 0x06000B13 RID: 2835 RVA: 0x00047654 File Offset: 0x00045854
 internal void LoadMessagesForThread(InboxThread inboxThread, int pageIndex)
 {
     inboxThread.IsLoading = true;
     PrivateMessageWebServiceClient.GetThreadMessages(PlayerDataManager.AuthToken, inboxThread.ThreadId, pageIndex, delegate(List <PrivateMessageView> list)
     {
         inboxThread.IsLoading = false;
         this.OnGetMessages(inboxThread.ThreadId, list);
     }, delegate(Exception ex)
     {
     });
 }
 // Token: 0x06000B59 RID: 2905 RVA: 0x0004828C File Offset: 0x0004648C
 private void DoThreads(Rect rect)
 {
     rect = new Rect(rect.x + 8f, rect.y, rect.width - 8f, rect.height - 8f);
     GUI.Box(rect, GUIContent.none, BlueStonez.window);
     if (Singleton <InboxManager> .Instance.ThreadCount > 0)
     {
         Vector2 threadScroll = GUITools.BeginScrollView(rect, this._threadScroll, new Rect(0f, 0f, (float)this._threadViewWidth, (float)this._threadViewHeight), false, false, true);
         bool    flag         = threadScroll.y > this._threadScroll.y;
         this._threadScroll = threadScroll;
         int num = 0;
         for (int i = 0; i < Singleton <InboxManager> .Instance.ThreadCount; i++)
         {
             InboxThread inboxThread = Singleton <InboxManager> .Instance.AllThreads[i];
             if (string.IsNullOrEmpty(this._searchMessage) || inboxThread.Contains(this._searchMessage))
             {
                 num = inboxThread.DrawThread(num, this._threadViewWidth);
                 GUI.Label(new Rect(4f, (float)num, (float)this._threadViewWidth, 1f), GUIContent.none, BlueStonez.horizontal_line_grey95);
             }
         }
         if (Singleton <InboxManager> .Instance.IsLoadingThreads)
         {
             GUI.Label(new Rect(0f, (float)num, rect.width, 30f), "Loading threads...", BlueStonez.label_interparkmed_11pt);
             num += 30;
         }
         else
         {
             if (Singleton <InboxManager> .Instance.IsNoMoreThreads)
             {
                 GUI.contentColor = Color.gray;
                 GUI.Label(new Rect(0f, (float)num, rect.width, 30f), "No more threads", BlueStonez.label_interparkmed_11pt);
                 GUI.contentColor = Color.white;
             }
             num += 30;
             float num2 = Mathf.Max((float)num - rect.height, 0f);
             if (flag && this._threadScroll.y >= num2)
             {
                 Singleton <InboxManager> .Instance.LoadNextPageThreads();
             }
         }
         this._threadViewHeight = num;
         this._threadViewWidth  = (int)(((float)this._threadViewHeight <= rect.height) ? (rect.width - 8f) : (rect.width - 22f));
         GUITools.EndScrollView();
     }
     else if (Singleton <InboxManager> .Instance.IsLoadingThreads)
     {
         GUI.Label(rect, "Loading threads...", BlueStonez.label_interparkbold_13pt);
     }
     else
     {
         GUI.Label(rect, LocalizedStrings.Empty, BlueStonez.label_interparkmed_11pt);
     }
 }
    // Token: 0x06000B18 RID: 2840 RVA: 0x00047810 File Offset: 0x00045A10
    private void AddMessageToThread(int threadId, PrivateMessageView privateMessage)
    {
        InboxThread inboxThread;

        if (!this._allThreads.TryGetValue(threadId, out inboxThread))
        {
            inboxThread = new InboxThread(new MessageThreadView
            {
                ThreadName = privateMessage.FromName,
                ThreadId   = threadId
            });
            this._allThreads.Add(inboxThread.ThreadId, inboxThread);
            this._sortedAllThreads.Add(inboxThread);
        }
        inboxThread.AddMessage(privateMessage);
        this.UpdateNewMessageCount();
    }
 // Token: 0x06000B14 RID: 2836 RVA: 0x000476C4 File Offset: 0x000458C4
 private void OnGetThreads(List <MessageThreadView> threadView)
 {
     foreach (MessageThreadView messageThreadView in threadView)
     {
         InboxThread inboxThread;
         if (this._allThreads.TryGetValue(messageThreadView.ThreadId, out inboxThread))
         {
             inboxThread.UpdateThread(messageThreadView);
         }
         else
         {
             inboxThread = new InboxThread(messageThreadView);
             this._allThreads.Add(inboxThread.ThreadId, inboxThread);
             this._sortedAllThreads.Add(inboxThread);
         }
     }
     this.UpdateNewMessageCount();
 }