QString title(const Chat& chat) { if (!chat.display().isEmpty()) return chat.display(); else return chat.name(); }