mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Remove direct usages of TabSupervisor from Chatview
- There still might be inherited usages - It's still used in the ctor Areas to test - Mentions - Chat notifications - Username clickable links
This commit is contained in:
parent
2c3b85aed3
commit
d65a444ac5
11 changed files with 104 additions and 100 deletions
|
|
@ -604,4 +604,34 @@ void TabSupervisor::processNotifyUserEvent(const Event_NotifyUser &event)
|
|||
default: ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
const QString TabSupervisor::getOwnUsername() const
|
||||
{
|
||||
return QString::fromStdString(userInfo->name());
|
||||
}
|
||||
|
||||
bool TabSupervisor::isUserBuddy(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return false;
|
||||
if (!getUserListsTab()->getBuddyList()) return false;
|
||||
QMap<QString, UserListTWI *> buddyList = getUserListsTab()->getBuddyList()->getUsers();
|
||||
bool senderIsBuddy = buddyList.contains(userName);
|
||||
return senderIsBuddy;
|
||||
}
|
||||
|
||||
const ServerInfo_User * TabSupervisor::getOnlineUser(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return nullptr;
|
||||
if (!getUserListsTab()->getAllUsersList()) return nullptr;
|
||||
QMap<QString, UserListTWI *> userList = getUserListsTab()->getAllUsersList()->getUsers();
|
||||
const QString &userNameToMatchLower = userName.toLower();
|
||||
QMap<QString, UserListTWI *>::iterator i;
|
||||
|
||||
for (i = userList.begin(); i != userList.end(); ++i)
|
||||
if (i.key().toLower() == userNameToMatchLower) {
|
||||
const ServerInfo_User &userInfo = i.value()->getUserInfo();
|
||||
return &userInfo;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue