chatgui: channel sorting by name or last message time with preview
- Add last_msg_at column to channels table - Update last_msg_at on every message insert (send/receive) - Parameterize getChannels() with ChannelSortMode enum (Alphabetical/Recent) - Add getChannelLastMessage() for preview text in channel list - Add sorting combo to Profile settings page (stored in ui_state) - Reload channels on message receive when sort is recent
This commit is contained in:
1 parent
332df381d1
commit
49da899964
10 files changed
+105
-12
No files matched your search
@@ -340,6 +340,7 @@ void MainWindow::showJoinDialog() {
|
||||
void MainWindow::showSettings() {
|
||||
SettingsDialog dlg(m_cfgPath, m_db, m_node, this);
|
||||
dlg.exec();
|
||||
reloadChannels();
|
||||
}
|
||||
|
||||
void MainWindow::onMessageReceived(const char* ch_id, int ch_id_len, uint64_t author) {
|
||||
@@ -358,6 +359,8 @@ void MainWindow::onMessageReceived(const char* ch_id, int ch_id_len, uint64_t au
|
||||
m_channelList->setChannelUnreadCount(cid, unread);
|
||||
}
|
||||
}
|
||||
if (m_db && m_db->getUiStateInt("channel_sort", 0) == 1)
|
||||
reloadChannels();
|
||||
}
|
||||
|
||||
void MainWindow::onMembersChanged(const char* ch_id) {
|
||||
|
||||
Reference in new issue
Block a user