Do not emit new message if it is a state event.

This commit is contained in:
Black Hat 2018-11-21 19:52:26 +08:00
parent 9ad062ca30
commit 3ec1cf71bf
3 changed files with 14 additions and 5 deletions

View File

@ -69,6 +69,8 @@ ColumnLayout {
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
Layout.leftMargin: 12
Layout.rightMargin: 12
color: MSettings.darkTheme ? "#424242" : "#e7ebeb"
}

View File

@ -114,6 +114,8 @@ Control {
Layout.fillWidth: true
Layout.margins: 8
id: replyItem
visible: isReply
spacing: 8
@ -145,14 +147,18 @@ Control {
textArea: inputField
emojiModel: EmojiModel { id: emojiModel }
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
Layout.leftMargin: 12
Layout.rightMargin: 12
visible: emojiPicker.visible || replyItem.visible
color: MSettings.darkTheme ? "#424242" : "#e7ebeb"
}
}
RowLayout {
Layout.fillWidth: true

View File

@ -77,6 +77,7 @@ void RoomListModel::connectRoomSignals(SpectralRoom* room) {
connect(room, &Room::aboutToAddNewMessages, this,
[=](QMatrixClient::RoomEventsRange eventsRange) {
RoomEvent* event = (eventsRange.end() - 1)->get();
if (event->isStateEvent()) return;
User* sender = room->user(event->senderId());
if (sender == room->localUser()) return;
QUrl _url = room->avatarUrl();