From 87933ba82d6a3a95775c299bd89aa157349fe799 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Thu, 3 Mar 2011 18:03:54 +0100 Subject: [PATCH] fix --- cockatrice/src/playerlistwidget.cpp | 2 +- cockatrice/src/tab_supervisor.cpp | 1 + cockatrice/src/tab_supervisor.h | 2 ++ cockatrice/src/userlist.cpp | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/playerlistwidget.cpp b/cockatrice/src/playerlistwidget.cpp index 70a3b746..1cd01d67 100644 --- a/cockatrice/src/playerlistwidget.cpp +++ b/cockatrice/src/playerlistwidget.cpp @@ -149,7 +149,7 @@ void PlayerListWidget::showContextMenu(const QPoint &pos, const QModelIndex &ind menu->addSeparator(); menu->addAction(aDetails); menu->addAction(aChat); - if (userLevel & ServerInfo_User::IsRegistered) { + if ((userLevel & ServerInfo_User::IsRegistered) && (tabSupervisor->getUserLevel() & ServerInfo_User::IsRegistered)) { menu->addSeparator(); if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName)) menu->addAction(aRemoveFromBuddyList); diff --git a/cockatrice/src/tab_supervisor.cpp b/cockatrice/src/tab_supervisor.cpp index 7a79b5cc..2d09bb12 100644 --- a/cockatrice/src/tab_supervisor.cpp +++ b/cockatrice/src/tab_supervisor.cpp @@ -57,6 +57,7 @@ void TabSupervisor::start(AbstractClient *_client, ServerInfo_User *userInfo) { client = _client; userName = userInfo->getName(); + userLevel = userInfo->getUserLevel(); connect(client, SIGNAL(roomEventReceived(RoomEvent *)), this, SLOT(processRoomEvent(RoomEvent *))); connect(client, SIGNAL(gameEventContainerReceived(GameEventContainer *)), this, SLOT(processGameEventContainer(GameEventContainer *))); diff --git a/cockatrice/src/tab_supervisor.h b/cockatrice/src/tab_supervisor.h index 61e5987d..087d9327 100644 --- a/cockatrice/src/tab_supervisor.h +++ b/cockatrice/src/tab_supervisor.h @@ -25,6 +25,7 @@ class TabSupervisor : public QTabWidget { Q_OBJECT private: QString userName; + int userLevel; QIcon *tabChangedIcon; AbstractClient *client; QList localClients; @@ -46,6 +47,7 @@ public: int getGameCount() const { return gameTabs.size(); } TabUserLists *getUserListsTab() const { return tabUserLists; } bool getAdminLocked() const; + int getUserLevel() const { return userLevel; } signals: void setMenu(QMenu *menu); void localGameEnded(); diff --git a/cockatrice/src/userlist.cpp b/cockatrice/src/userlist.cpp index e365ba0a..b63c6805 100644 --- a/cockatrice/src/userlist.cpp +++ b/cockatrice/src/userlist.cpp @@ -183,7 +183,7 @@ void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index) menu->addSeparator(); menu->addAction(aDetails); menu->addAction(aChat); - if (userLevel & ServerInfo_User::IsRegistered) { + if ((userLevel & ServerInfo_User::IsRegistered) && (tabSupervisor->getUserLevel() & ServerInfo_User::IsRegistered)) { menu->addSeparator(); if (tabSupervisor->getUserListsTab()->getBuddyList()->userInList(userName)) menu->addAction(aRemoveFromBuddyList);