Code style

This commit is contained in:
Carl Schwan
2020-12-01 11:56:50 +01:00
parent c5e2acdd5d
commit b62e694c97

View File

@@ -142,13 +142,14 @@ void RoomListModel::connectRoomSignals(NeoChatRoom *room)
return; return;
} }
if (!lastEvent->isStateEvent()) { if (lastEvent->isStateEvent()) {
User *sender = room->user(lastEvent->senderId()); return;
if (sender == room->localUser()) {
return;
}
Q_EMIT newMessage(room->id(), lastEvent->id(), room->displayName(), sender->displayname(), room->eventToString(*lastEvent), room->avatar(128));
} }
User *sender = room->user(lastEvent->senderId());
if (sender == room->localUser()) {
return;
}
Q_EMIT newMessage(room->id(), lastEvent->id(), room->displayName(), sender->displayname(), room->eventToString(*lastEvent), room->avatar(128));
}); });
connect(room, &Room::highlightCountChanged, this, [=] { connect(room, &Room::highlightCountChanged, this, [=] {
if (room->highlightCount() == 0) { if (room->highlightCount() == 0) {
@@ -164,12 +165,13 @@ void RoomListModel::connectRoomSignals(NeoChatRoom *room)
} }
if (!lastEvent->isStateEvent()) { if (!lastEvent->isStateEvent()) {
User *sender = room->user(lastEvent->senderId()); return;
if (sender == room->localUser()) {
return;
}
Q_EMIT newHighlight(room->id(), lastEvent->id(), room->displayName(), sender->displayname(), room->eventToString(*lastEvent), room->avatar(128));
} }
User *sender = room->user(lastEvent->senderId());
if (sender == room->localUser()) {
return;
}
Q_EMIT newHighlight(room->id(), lastEvent->id(), room->displayName(), sender->displayname(), room->eventToString(*lastEvent), room->avatar(128));
}); });
connect(room, &Room::notificationCountChanged, this, &RoomListModel::refreshNotificationCount); connect(room, &Room::notificationCountChanged, this, &RoomListModel::refreshNotificationCount);
} }