X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.cpp;h=6e40c0995a52d9093cc0b146de65bf14f5b3ca43;hp=dbddaaa7ced5505570002304a7e98a33fc581465;hb=533eaaeda64759c01daa624365b8fc63eeba5ccf;hpb=94be5fb31afd8f3befa8cb2cf1b3c2e5ef3cdba5 diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index dbddaaa7..6e40c099 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -102,3 +102,15 @@ void ChatView::verticalScrollbarChanged(int newPos) { scene()->setIsFetchingBacklog(vbar->value() == vbar->minimum()); } } + +MsgId ChatView::lastMsgId() const { + if(!scene()) + return MsgId(); + + QAbstractItemModel *model = scene()->model(); + if(!model || model->rowCount() == 0) + return MsgId(); + + + return model->data(model->index(model->rowCount() - 1, 0), MessageModel::MsgIdRole).value(); +}