mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-03 09:21:31 -07:00
Merge pull request #1767 from Fizztastic/fix_1764
Sounds on buddy login & logout.
This commit is contained in:
@@ -170,6 +170,8 @@ void SoundEngine::themeChangedSlot()
|
||||
<< "player_join" << "player_leave" << "player_disconnect" << "player_reconnect" << "player_concede"
|
||||
// Spectator
|
||||
<< "spectator_join" << "spectator_leave"
|
||||
// Buddy
|
||||
<< "buddy_join" << "buddy_leave"
|
||||
// Chat & UI
|
||||
<< "chat_mention" << "all_mention" << "private_message";
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "userlist.h"
|
||||
#include "userinfobox.h"
|
||||
#include "abstractclient.h"
|
||||
#include "soundengine.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPushButton>
|
||||
@@ -146,12 +147,19 @@ void TabUserLists::processUserJoinedEvent(const Event_UserJoined &event)
|
||||
ignoreList->sortItems();
|
||||
buddyList->sortItems();
|
||||
|
||||
if (buddyList->getUsers().keys().contains(userName))
|
||||
soundEngine->playSound("buddy_join");
|
||||
|
||||
emit userJoined(info);
|
||||
}
|
||||
|
||||
void TabUserLists::processUserLeftEvent(const Event_UserLeft &event)
|
||||
{
|
||||
QString userName = QString::fromStdString(event.name());
|
||||
|
||||
if (buddyList->getUsers().keys().contains(userName))
|
||||
soundEngine->playSound("buddy_leave");
|
||||
|
||||
if (allUsersList->deleteUser(userName)) {
|
||||
ignoreList->setUserOnline(userName, false);
|
||||
buddyList->setUserOnline(userName, false);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user