diff options
-rw-r--r-- | src/Message.h | 4 | ||||
-rw-r--r-- | src/Player.h | 2 | ||||
-rw-r--r-- | src/mumble/Messages.cpp | 4 | ||||
-rw-r--r-- | src/mumble/Plugins.h | 2 | ||||
-rw-r--r-- | src/murmur/Messages.cpp | 12 |
5 files changed, 22 insertions, 2 deletions
diff --git a/src/Message.h b/src/Message.h index 94a07ef67..ac53df5bf 100644 --- a/src/Message.h +++ b/src/Message.h @@ -69,6 +69,10 @@ inline QString u8(const ::std::string &str) { return QString::fromUtf8(str.data(), str.length()); } +inline QString u8(const ::std::wstring &str) { + return QString::fromStdWString(str); +} + inline ::std::string u8(const QString &str) { const QByteArray &qba = str.toUtf8(); return ::std::string(qba.constData(), qba.length()); diff --git a/src/Player.h b/src/Player.h index 610ec1003..d5ce8eead 100644 --- a/src/Player.h +++ b/src/Player.h @@ -50,6 +50,8 @@ class Player { bool bTalking, bAltSpeak; Channel *cChannel; QByteArray qbaTexture; + std::string ssContext; + QString qsIdentity; QString getFlagsString() const; Player(); diff --git a/src/mumble/Messages.cpp b/src/mumble/Messages.cpp index d136c464e..68a754992 100644 --- a/src/mumble/Messages.cpp +++ b/src/mumble/Messages.cpp @@ -221,6 +221,10 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) { pDst->qbaTexture = QByteArray(str.data(), str.size()); g.o->verifyTexture(pDst); } + if (msg.has_plugin_context()) { + QMutexLocker qml(&g.p->qmPlugins); + pDst->ssContext = msg.plugin_context(); + } } void MainWindow::msgUserRemove(const MumbleProto::UserRemove &msg) { diff --git a/src/mumble/Plugins.h b/src/mumble/Plugins.h index 24eb2082c..f2c5013a9 100644 --- a/src/mumble/Plugins.h +++ b/src/mumble/Plugins.h @@ -62,11 +62,11 @@ class Plugins : public QObject { Q_OBJECT Q_DISABLE_COPY(Plugins) protected: - QMutex qmPlugins; QList<PluginInfo *> qlPlugins; PluginInfo *locked; PluginInfo *prevlocked; public: + QMutex qmPlugins; std::string ssContext, ssContextSent; std::wstring swsIdentity, swsIdentitySent; bool bValid; diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp index ae87fb3ae..e8c303c2d 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp @@ -242,6 +242,8 @@ void Server::msgAuthenticate(User *uSource, MumbleProto::Authenticate &msg) { else if (u->bSelfMute) mpus.set_self_mute(true); + if (! u->ssContext.empty()) + mpus.set_plugin_context(u->ssContext); sendMessage(uSource, mpus); } @@ -356,7 +358,7 @@ void Server::msgUserState(User *uSource, MumbleProto::UserState &msg) { } } - if ((pDstUser != uSource) && (msg.has_self_deaf() || msg.has_self_mute() || msg.has_texture())) + if ((pDstUser != uSource) && (msg.has_self_deaf() || msg.has_self_mute() || msg.has_texture() || msg.has_plugin_context() || msg.has_plugin_identity())) return; // Permission checks done. Now enact this. @@ -374,7 +376,15 @@ void Server::msgUserState(User *uSource, MumbleProto::UserState &msg) { uSource->bSelfDeaf = false; } } + + if (msg.has_plugin_context()) { + uSource->ssContext = msg.plugin_context(); + } + if (msg.has_plugin_identity()) { + uSource->qsIdentity = u8(msg.plugin_identity()); + msg.clear_plugin_identity(); + } if (msg.has_channel_id()) { Channel *c = qhChannels.value(msg.channel_id()); |