22 class ChatMessagePacer;
23 class UnreadThreadCache;
61 int32_t GetUnreadCount()
const;
71 void UpdateThread(
const std::string& threadId,
MessageId lastMessageId,
MessageId lastReadMessageId);
75 bool ContainsThread(
const std::string& threadId)
const;
80 void RealtimeMessageReceived(
const std::string& threadId,
MessageId id);
81 void RealtimeMessageSent(
const std::string& threadId,
MessageId id);
82 void MarkThreadRead(
const std::string& threadId,
MessageId lastReadId);
83 void MarkThreadRead(
const std::string& threadId);
std::string threadId
Definition: chathelpers.h:57
Definition: chathelpers.h:55
UserMode ParseUserType(const std::string &str)
static const uint kMessagePacingWindowSize
Definition: chathelpers.h:44
uint32_t MessageId
Definition: chattypes.h:26
Definition: chathelpers.h:52
int32_t mNumUnreadThreads
Definition: chathelpers.h:87
int32_t mNumUnreadMessages
Definition: chathelpers.h:88
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Color GetRandomUserColor(const std::string &username)
Definition: chathelpers.h:35
bool GetExhaustive() const
Definition: chathelpers.h:73
Definition: chattypes.h:745
bool mDirty
Whether the cache has changed since the last time the unread counts callbacks notified the user...
Definition: chathelpers.h:91
void MarkClean()
Definition: chathelpers.h:78
void SetExhaustive(bool exhaustive)
Definition: chathelpers.h:72
unsigned int uint
Definition: coretypes.h:18
bool GetDirty()
Definition: chathelpers.h:77
void UnescapeEmoticonToken(std::string &token)
uint32_t GetNumUnreadThreads() const
Definition: chathelpers.h:66
MessageId lastReadMessageId
Definition: chathelpers.h:58
std::map< std::string, ThreadData > mUnreadThreads
Definition: chathelpers.h:86
MessageId lastMessageId
Definition: chathelpers.h:59
SubscriptionStatus ParseSubscriptionStatus(const std::string &str)
std::array< uint64_t, kMessagePacingWindowSize > mMessageSubmissionTimes
The ring buffer of timestamps for the last n messages submitted. This is used for preventing the clie...
Definition: chathelpers.h:47
uint32_t Color
Definition: coretypes.h:28
static const uint kMessagePacingTimeSpanSeconds
Definition: chathelpers.h:45
uint mNextMessageSubmissionIndex
The index of the next entry to write in mMessageSubmissionTimes.
Definition: chathelpers.h:48
uint32_t GetNumUnreadMessages() const
Definition: chathelpers.h:67
bool mExhaustive
exhaustive = false means we need to poll the endpoint after each action for more accurate counts ...
Definition: chathelpers.h:89