fix for regression issue 669 "Lobby: User context-menu of offline user shows all options as if user was still online"
authorsheepluva
Sat, 30 Nov 2013 14:36:41 +0100
changeset 9728 320f89e0b28c
parent 9727 e89ed65f62da
child 9729 6a3640c4f4b7
fix for regression issue #669 "Lobby: User context-menu of offline user shows all options as if user was still online"
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Sat Nov 30 14:33:23 2013 +0100
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Sat Nov 30 14:36:41 2013 +0100
@@ -861,6 +861,8 @@
     else
         nick = m_clickedNick;
 
+    bool isOnline = (mil.size() > 0);
+
     QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
     if(!playersSortFilterModel)
         return;
@@ -875,6 +877,8 @@
 
     acFollow->setVisible(!isSelf && isInRoom);
 
+    acInfo->setVisible(isOnline);
+
     // update context menu labels according to possible action
     if(players->isFlagSet(nick, PlayersListModel::Ignore))
     {
@@ -902,7 +906,7 @@
 
     if (m_isAdmin)
     {
-        acKick->setVisible(!isSelf);
+        acKick->setVisible(!isSelf && isOnline);
         acBan->setVisible(!isSelf);
     }