diff --git a/tools/chatgui/src/channellist.cpp b/tools/chatgui/src/channellist.cpp index b69b30ac..4a66786a 100644 --- a/tools/chatgui/src/channellist.cpp +++ b/tools/chatgui/src/channellist.cpp @@ -56,7 +56,8 @@ protected: } void selectionChanged(const QItemSelection& sel, const QItemSelection& desel) override { QListView::selectionChanged(sel, desel); - if (selectionModel() && !selectionModel()->hasSelection() && currentIndex().isValid()) + if (selectionModel() && !selectionModel()->hasSelection() && currentIndex().isValid() + && currentIndex().row() < model()->rowCount()) selectionModel()->select(currentIndex(), QItemSelectionModel::ClearAndSelect); } diff --git a/tools/chatgui/transport/chat_sync.c b/tools/chatgui/transport/chat_sync.c index 34de5e52..a9f4241a 100644 --- a/tools/chatgui/transport/chat_sync.c +++ b/tools/chatgui/transport/chat_sync.c @@ -508,6 +508,9 @@ static void cs_refresh_channels(struct chat_sync* cs) { memcpy(&cs->channels[i].peer_ids[j], peer_buf + 2 + j * 8, 8); } } + + for (int i = 0; i < cs->channel_count; i++) + cs_post_channel_online(cs, cs->channels[i].channel_id); } static void refresh_timer_cb(void* arg) {