Fix showAuthor
This commit is contained in:
@@ -4,11 +4,13 @@
|
||||
#include "messagefiltermodel.h"
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <qvariant.h>
|
||||
|
||||
#include "enums/delegatetype.h"
|
||||
#include "messagecontentmodel.h"
|
||||
#include "messageeventmodel.h"
|
||||
#include "neochatconfig.h"
|
||||
#include "neochatroommember.h"
|
||||
#include "timelinemodel.h"
|
||||
|
||||
using namespace Quotient;
|
||||
@@ -120,7 +122,8 @@ bool MessageFilterModel::showAuthor(QModelIndex index) const
|
||||
// While the row is removed the subsequent row indexes are not changed so we need to skip over the removed index.
|
||||
// See - https://doc.qt.io/qt-5/qabstractitemmodel.html#beginRemoveRows
|
||||
if (data(i, MessageEventModel::SpecialMarksRole) != EventStatus::Hidden && !itemData(i).empty()) {
|
||||
return data(i, MessageEventModel::AuthorRole) != data(index, MessageEventModel::AuthorRole)
|
||||
return qvariant_cast<NeochatRoomMember *>(data(i, MessageEventModel::AuthorRole))->id()
|
||||
!= qvariant_cast<NeochatRoomMember *>(data(index, MessageEventModel::AuthorRole))->id()
|
||||
|| data(i, MessageEventModel::DelegateTypeRole) == DelegateType::State
|
||||
|| data(i, MessageEventModel::TimeRole).toDateTime().msecsTo(data(index, MessageEventModel::TimeRole).toDateTime()) > 600000
|
||||
|| data(i, MessageEventModel::TimeRole).toDateTime().toLocalTime().date().day()
|
||||
|
||||
@@ -23,11 +23,6 @@ NeochatRoomMember::NeochatRoomMember(NeoChatRoom *room, const QString &memberId)
|
||||
}
|
||||
}
|
||||
|
||||
bool NeochatRoomMember::operator==(const NeochatRoomMember &other) const
|
||||
{
|
||||
return id() == other.id();
|
||||
}
|
||||
|
||||
QString NeochatRoomMember::id() const
|
||||
{
|
||||
return m_memberId;
|
||||
|
||||
@@ -51,8 +51,6 @@ public:
|
||||
|
||||
explicit NeochatRoomMember(NeoChatRoom *room, const QString &memberId);
|
||||
|
||||
bool operator==(const NeochatRoomMember &other) const;
|
||||
|
||||
/**
|
||||
* @brief Get unique stable user id
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user