Handle case with no available rooms

fixes #181
This commit is contained in:
Konstantinos Sideris 2018-02-02 10:50:02 -07:00
parent 73bc1ffa7b
commit 43ba4d5ed5
2 changed files with 9 additions and 0 deletions

View file

@ -144,6 +144,9 @@ TopRoomBar::TopRoomBar(QWidget *parent)
menu_->addAction(leaveRoom_);
connect(settingsBtn_, &QPushButton::clicked, this, [=]() {
if (roomSettings_.isNull())
return;
if (roomSettings_->isNotificationsEnabled())
toggleNotifications_->setText(tr("Disable notifications"));
else

View file

@ -68,6 +68,9 @@ TimelineViewManager::messageSendFailed(const QString &roomid, int txn_id)
void
TimelineViewManager::queueTextMessage(const QString &msg)
{
if (active_room_.isEmpty())
return;
auto room_id = active_room_;
auto view = views_[room_id];
@ -77,6 +80,9 @@ TimelineViewManager::queueTextMessage(const QString &msg)
void
TimelineViewManager::queueEmoteMessage(const QString &msg)
{
if (active_room_.isEmpty())
return;
auto room_id = active_room_;
auto view = views_[room_id];