MCPcopy Create free account
hub / github.com/davidar/tensor / newMessage

Method newMessage

client/models/messageeventmodel.cpp:216–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void MessageEventModel::newMessage(QMatrixClient::Event* messageEvent)
217{
218 //qDebug() << "Message: " << message;
219 if( messageEvent->type() == QMatrixClient::EventType::Typing )
220 {
221 return;
222 }
223 for( int i = m_currentMessages.count() - 1; i >= 0; i-- )
224 {
225 if( messageEvent->timestamp() < m_currentMessages.at(i)->timestamp() )
226 {
227 beginInsertRows(QModelIndex(), i+1, i+1);
228 m_currentMessages.insert(i+1, messageEvent);
229 endInsertRows();
230 return;
231 }
232 }
233 beginInsertRows(QModelIndex(), 0, 0);
234 m_currentMessages.insert(0, messageEvent);
235 endInsertRows();
236}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected