mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Fix #1764
Add Sounds on buddy login & logout. Add Files: buddy_join.wav; buddy_leave.wav
This commit is contained in:
parent
d2e731bb2b
commit
9767b1f69d
4 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue