mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Reduce TabSupervisor direct usage in UserContextMenu
This commit is contained in:
parent
c5aa75d4d1
commit
a3f4012d1a
5 changed files with 25 additions and 7 deletions
|
|
@ -605,6 +605,12 @@ void TabSupervisor::processNotifyUserEvent(const Event_NotifyUser &event)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
const bool TabSupervisor::isOwnUserRegistered() const
|
||||
{
|
||||
return (bool) getUserInfo()->user_level() & ServerInfo_User::IsRegistered;
|
||||
}
|
||||
|
||||
const QString TabSupervisor::getOwnUsername() const
|
||||
{
|
||||
return QString::fromStdString(userInfo->name());
|
||||
|
|
@ -619,6 +625,15 @@ bool TabSupervisor::isUserBuddy(const QString &userName) const
|
|||
return senderIsBuddy;
|
||||
}
|
||||
|
||||
bool TabSupervisor::isUserIgnored(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return false;
|
||||
if (!getUserListsTab()->getIgnoreList()) return false;
|
||||
QMap<QString, UserListTWI *> buddyList = getUserListsTab()->getIgnoreList()->getUsers();
|
||||
bool senderIsBuddy = buddyList.contains(userName);
|
||||
return senderIsBuddy;
|
||||
}
|
||||
|
||||
const ServerInfo_User * TabSupervisor::getOnlineUser(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue