MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / addMessage

Method addMessage

Tactility/Source/app/chat/ChatState.cpp:35–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void ChatState::addMessage(const StoredMessage& msg) {
36 auto lock = mutex.asScopedLock();
37 lock.lock();
38 if (messages.size() >= MAX_MESSAGES) {
39 messages.pop_front();
40 }
41 messages.push_back(msg);
42}
43
44std::vector<StoredMessage> ChatState::getFilteredMessages() const {
45 auto lock = mutex.asScopedLock();

Callers 2

onReceiveMethod · 0.80
sendMessageMethod · 0.80

Calls 2

asScopedLockMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected