Init scroll to eventid.
This commit is contained in:
@@ -470,3 +470,12 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
int MessageEventModel::eventIDToIndex(const QString& eventID) {
|
||||
const auto it = m_currentRoom->findInTimeline(eventID);
|
||||
if (it == m_currentRoom->timelineEdge()) {
|
||||
qWarning() << "Trying to find inexistent event:" << eventID;
|
||||
return -1;
|
||||
}
|
||||
return it - m_currentRoom->messageEvents().rbegin() + timelineBaseIndex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user