|
|
@ -15,6 +15,8 @@ |
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <limits> |
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QApplication> |
|
|
|
#include <QBuffer> |
|
|
|
#include <QBuffer> |
|
|
|
#include <QObject> |
|
|
|
#include <QObject> |
|
|
@ -191,6 +193,9 @@ RoomList::sync(const std::map<QString, RoomInfo> &info) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (const auto &room : info) |
|
|
|
for (const auto &room : info) |
|
|
|
updateRoom(room.first, room.second); |
|
|
|
updateRoom(room.first, room.second); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!info.empty()) |
|
|
|
|
|
|
|
sortRoomsByLastMessage(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
@ -270,7 +275,9 @@ RoomList::sortRoomsByLastMessage() |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
// Not a room message.
|
|
|
|
// Not a room message.
|
|
|
|
if (room->lastMessageInfo().userid.isEmpty()) |
|
|
|
if (room->isInvite()) |
|
|
|
|
|
|
|
times.emplace(std::numeric_limits<uint64_t>::max(), room); |
|
|
|
|
|
|
|
else if (room->lastMessageInfo().userid.isEmpty()) |
|
|
|
times.emplace(0, room); |
|
|
|
times.emplace(0, room); |
|
|
|
else |
|
|
|
else |
|
|
|
times.emplace(room->lastMessageInfo().datetime.toMSecsSinceEpoch(), room); |
|
|
|
times.emplace(room->lastMessageInfo().datetime.toMSecsSinceEpoch(), room); |
|
|
|