diff options
author | Robert Adam <krzmbrzl@gmail.com> | 2021-03-01 11:28:01 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2021-03-02 21:53:51 +0300 |
commit | 863055bed1dff35416a5f508574c85f19ac0f9dd (patch) | |
tree | 8432836612d038c16ab61df7df9193f3b959dd9d /src | |
parent | cdbc4058874f623b7b5404a6502cf2bc426abbb6 (diff) |
FEAT(server, ice): Ability to broadcast welcome text
This allows server admins to explicitly trigger the broadcast of the
currently set welcome text to a given set of users.
By first setting a new welcome text and then broadcasting it to all
currently connected users, the old behavior of setting the welcome
message (changed in da26386827a5802cfc82ce45cb8b30469e83d73f) can be
restored.
Fixes #4805
Diffstat (limited to 'src')
-rw-r--r-- | src/murmur/Murmur.ice | 5 | ||||
-rw-r--r-- | src/murmur/MurmurI.h | 3 | ||||
-rw-r--r-- | src/murmur/MurmurIce.cpp | 12 | ||||
-rw-r--r-- | src/murmur/MurmurIceWrapper.cpp | 36 | ||||
-rw-r--r-- | src/murmur/RPC.cpp | 7 | ||||
-rw-r--r-- | src/murmur/Server.h | 1 |
6 files changed, 62 insertions, 2 deletions
diff --git a/src/murmur/Murmur.ice b/src/murmur/Murmur.ice index 65393e863..1dff7fca3 100644 --- a/src/murmur/Murmur.ice +++ b/src/murmur/Murmur.ice @@ -823,6 +823,11 @@ module Murmur * @returns An ID-list of users listening to the given channel */ idempotent IntList getListeningUsers(int channelid); + + /** + * @param receiverUserIDs list of IDs of the users the message shall be sent to + */ + idempotent void sendWelcomeMessage(IdList receiverUserIDs); }; /** Callback interface for Meta. You can supply an implementation of this to receive notifications diff --git a/src/murmur/MurmurI.h b/src/murmur/MurmurI.h index be17deddc..8dcb23e27 100644 --- a/src/murmur/MurmurI.h +++ b/src/murmur/MurmurI.h @@ -155,6 +155,9 @@ public: virtual void getListeningUsers_async(const ::Murmur::AMD_Server_getListeningUsersPtr &, ::Ice::Int, const Ice::Current &); + virtual void sendWelcomeMessage_async(const ::Murmur::AMD_Server_sendWelcomeMessagePtr &, + const ::Murmur::IdList &p1, const ::Ice::Current ¤t); + virtual void ice_ping(const Ice::Current &) const; }; diff --git a/src/murmur/MurmurIce.cpp b/src/murmur/MurmurIce.cpp index a9525a86b..a3a13751b 100644 --- a/src/murmur/MurmurIce.cpp +++ b/src/murmur/MurmurIce.cpp @@ -1765,6 +1765,18 @@ static void impl_Server_getListeningUsers(const ::Murmur::AMD_Server_getListenin cb->ice_response(userSessions); } +static void impl_Server_sendWelcomeMessage(const ::Murmur::AMD_Server_sendWelcomeMessagePtr cb, int server_id, ::Murmur::IdList receiverUserIDs) { + NEED_SERVER; + + for (unsigned int session : receiverUserIDs) { + NEED_PLAYER; + + server->sendWelcomeMessageTo(user); + } + + cb->ice_response(); +} + static void impl_Server_addUserToGroup(const ::Murmur::AMD_Server_addUserToGroupPtr cb, int server_id, ::Ice::Int channelid, ::Ice::Int session, const ::std::string &group) { NEED_SERVER; diff --git a/src/murmur/MurmurIceWrapper.cpp b/src/murmur/MurmurIceWrapper.cpp index 7d6a5ae3a..94c4abc30 100644 --- a/src/murmur/MurmurIceWrapper.cpp +++ b/src/murmur/MurmurIceWrapper.cpp @@ -3,7 +3,7 @@ // that can be found in the LICENSE file at the root of the // Mumble source tree or at <https://www.mumble.info/LICENSE>. -// This file was auto-generated by scripts/generateIceWrapper.py on 2020-09-12 -- DO NOT EDIT MANUALLY! +// This file was auto-generated by scripts/generateIceWrapper.py on 2021-03-01 -- DO NOT EDIT MANUALLY! #include <boost/bind/bind.hpp> @@ -1767,6 +1767,38 @@ void ::Murmur::ServerI::getListeningUsers_async(const ::Murmur::AMD_Server_getLi QCoreApplication::instance()->postEvent(mi, ie); } +void ::Murmur::ServerI::sendWelcomeMessage_async(const ::Murmur::AMD_Server_sendWelcomeMessagePtr &cb, const IdList& p1, const ::Ice::Current ¤t) { + // qWarning() << "sendWelcomeMessage" << meta->mp.qsIceSecretRead.isNull() << meta->mp.qsIceSecretRead.isEmpty(); +#ifndef ACCESS_Server_sendWelcomeMessage_ALL +# ifdef ACCESS_Server_sendWelcomeMessage_READ + if (!meta->mp.qsIceSecretRead.isNull()) { + bool ok = !meta->mp.qsIceSecretRead.isEmpty(); +# else + if (!meta->mp.qsIceSecretRead.isNull() || !meta->mp.qsIceSecretWrite.isNull()) { + bool ok = !meta->mp.qsIceSecretWrite.isEmpty(); +# endif // ACCESS_Server_sendWelcomeMessage_READ + ::Ice::Context::const_iterator i = current.ctx.find("secret"); + ok = ok && (i != current.ctx.end()); + if (ok) { + const QString &secret = u8((*i).second); +# ifdef ACCESS_Server_sendWelcomeMessage_READ + ok = ((secret == meta->mp.qsIceSecretRead) || (secret == meta->mp.qsIceSecretWrite)); +# else + ok = (secret == meta->mp.qsIceSecretWrite); +# endif // ACCESS_Server_sendWelcomeMessage_READ + } + + if (!ok) { + cb->ice_exception(InvalidSecretException()); + return; + } + } +#endif // ACCESS_Server_sendWelcomeMessage_ALL + + ExecEvent *ie = new ExecEvent(boost::bind(&impl_Server_sendWelcomeMessage, cb, QString::fromStdString(current.id.name).toInt(), p1)); + QCoreApplication::instance()->postEvent(mi, ie); +} + void ::Murmur::MetaI::getServer_async(const ::Murmur::AMD_Meta_getServerPtr &cb, ::Ice::Int p1, const ::Ice::Current ¤t) { // qWarning() << "getServer" << meta->mp.qsIceSecretRead.isNull() << meta->mp.qsIceSecretRead.isEmpty(); #ifndef ACCESS_Meta_getServer_ALL @@ -2088,5 +2120,5 @@ void ::Murmur::MetaI::getSliceChecksums_async(const ::Murmur::AMD_Meta_getSliceC } void ::Murmur::MetaI::getSlice_async(const ::Murmur::AMD_Meta_getSlicePtr &cb, const Ice::Current&) { - cb->ice_response(std::string("\n\n\n\n#include <Ice/SliceChecksumDict.ice>\nmodule Murmur\n{\n\n[\"python:seq:tuple\"] sequence<byte> NetAddress;\n\nstruct User {\nint session;\nint userid;\nbool mute;\nbool deaf;\nbool suppress;\nbool prioritySpeaker;\nbool selfMute;\nbool selfDeaf;\nbool recording;\nint channel;\nstring name;\nint onlinesecs;\nint bytespersec;\nint version;\nstring release;\nstring os;\nstring osversion;\nstring identity;\nstring context;\nstring comment;\nNetAddress address;\nbool tcponly;\nint idlesecs;\nfloat udpPing;\nfloat tcpPing;\n};\nsequence<int> IntList;\n\nstruct TextMessage {\nIntList sessions;\nIntList channels;\nIntList trees;\nstring text;\n};\n\nstruct Channel {\nint id;\nstring name;\nint parent;\nIntList links;\nstring description;\nbool temporary;\nint position;\n};\n\nstruct Group {\nstring name;\nbool inherited;\nbool inherit;\nbool inheritable;\nIntList add;\nIntList remove;\nIntList members;\n};\n\nconst int PermissionWrite = 0x01;\nconst int PermissionTraverse = 0x02;\nconst int PermissionEnter = 0x04;\nconst int PermissionSpeak = 0x08;\nconst int PermissionWhisper = 0x100;\nconst int PermissionMuteDeafen = 0x10;\nconst int PermissionMove = 0x20;\nconst int PermissionMakeChannel = 0x40;\nconst int PermissionMakeTempChannel = 0x400;\nconst int PermissionLinkChannel = 0x80;\nconst int PermissionTextMessage = 0x200;\nconst int PermissionKick = 0x10000;\nconst int PermissionBan = 0x20000;\nconst int PermissionRegister = 0x40000;\nconst int PermissionRegisterSelf = 0x80000;\nconst int ResetUserContent = 0x100000;\n\nstruct ACL {\nbool applyHere;\nbool applySubs;\nbool inherited;\nint userid;\nstring group;\nint allow;\nint deny;\n};\n\nstruct Ban {\nNetAddress address;\nint bits;\nstring name;\nstring hash;\nstring reason;\nint start;\nint duration;\n};\n\nstruct LogEntry {\nint timestamp;\nstring txt;\n};\nclass Tree;\nsequence<Tree> TreeList;\nenum ChannelInfo { ChannelDescription, ChannelPosition };\nenum UserInfo { UserName, UserEmail, UserComment, UserHash, UserPassword, UserLastActive, UserKDFIterations };\ndictionary<int, User> UserMap;\ndictionary<int, Channel> ChannelMap;\nsequence<Channel> ChannelList;\nsequence<User> UserList;\nsequence<Group> GroupList;\nsequence<ACL> ACLList;\nsequence<LogEntry> LogList;\nsequence<Ban> BanList;\nsequence<int> IdList;\nsequence<string> NameList;\ndictionary<int, string> NameMap;\ndictionary<string, int> IdMap;\nsequence<byte> Texture;\ndictionary<string, string> ConfigMap;\nsequence<string> GroupNameList;\nsequence<byte> CertificateDer;\nsequence<CertificateDer> CertificateList;\n\ndictionary<UserInfo, string> UserInfoMap;\n\nclass Tree {\nChannel c;\nTreeList children;\nUserList users;\n};\nexception MurmurException {};\nexception InvalidSessionException extends MurmurException {};\nexception InvalidChannelException extends MurmurException {};\nexception InvalidServerException extends MurmurException {};\nexception ServerBootedException extends MurmurException {};\nexception ServerFailureException extends MurmurException {};\nexception InvalidUserException extends MurmurException {};\nexception InvalidTextureException extends MurmurException {};\nexception InvalidCallbackException extends MurmurException {};\nexception InvalidSecretException extends MurmurException {};\nexception NestingLimitException extends MurmurException {};\nexception WriteOnlyException extends MurmurException {};\nexception InvalidInputDataException extends MurmurException {};\n\ninterface ServerCallback {\nidempotent void userConnected(User state);\nidempotent void userDisconnected(User state);\nidempotent void userStateChanged(User state);\nidempotent void userTextMessage(User state, TextMessage message);\nidempotent void channelCreated(Channel state);\nidempotent void channelRemoved(Channel state);\nidempotent void channelStateChanged(Channel state);\n};\n\nconst int ContextServer = 0x01;\nconst int ContextChannel = 0x02;\nconst int ContextUser = 0x04;\n\ninterface ServerContextCallback {\nidempotent void contextAction(string action, User usr, int session, int channelid);\n};\n\ninterface ServerAuthenticator {\nidempotent int authenticate(string name, string pw, CertificateList certificates, string certhash, bool certstrong, out string newname, out GroupNameList groups);\n\nidempotent bool getInfo(int id, out UserInfoMap info);\n\nidempotent int nameToId(string name);\n\nidempotent string idToName(int id);\n\nidempotent Texture idToTexture(int id);\n};\n\ninterface ServerUpdatingAuthenticator extends ServerAuthenticator {\nint registerUser(UserInfoMap info);\n\nint unregisterUser(int id);\n\nidempotent NameMap getRegisteredUsers(string filter);\n\nidempotent int setInfo(int id, UserInfoMap info);\n\nidempotent int setTexture(int id, Texture tex);\n};\n\n[\"amd\"] interface Server {\nidempotent bool isRunning() throws InvalidSecretException;\n\nvoid start() throws ServerBootedException, ServerFailureException, InvalidSecretException;\n\nvoid stop() throws ServerBootedException, InvalidSecretException;\n\nvoid delete() throws ServerBootedException, InvalidSecretException;\n\nidempotent int id() throws InvalidSecretException;\n\nvoid addCallback(ServerCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid removeCallback(ServerCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid setAuthenticator(ServerAuthenticator *auth) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nidempotent string getConf(string key) throws InvalidSecretException, WriteOnlyException;\n\nidempotent ConfigMap getAllConf() throws InvalidSecretException;\n\nidempotent void setConf(string key, string value) throws InvalidSecretException;\n\nidempotent void setSuperuserPassword(string pw) throws InvalidSecretException;\n\nidempotent LogList getLog(int first, int last) throws InvalidSecretException;\n\nidempotent int getLogLen() throws InvalidSecretException;\n\nidempotent UserMap getUsers() throws ServerBootedException, InvalidSecretException;\n\nidempotent ChannelMap getChannels() throws ServerBootedException, InvalidSecretException;\n\nidempotent CertificateList getCertificateList(int session) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent Tree getTree() throws ServerBootedException, InvalidSecretException;\n\nidempotent BanList getBans() throws ServerBootedException, InvalidSecretException;\n\nidempotent void setBans(BanList bans) throws ServerBootedException, InvalidSecretException;\n\nvoid kickUser(int session, string reason) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent User getState(int session) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent void setState(User state) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nvoid sendMessage(int session, string text) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nbool hasPermission(int session, int channelid, int perm) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nidempotent int effectivePermissions(int session, int channelid) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nvoid addContextCallback(int session, string action, string text, ServerContextCallback *cb, int ctx) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid removeContextCallback(ServerContextCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nidempotent Channel getChannelState(int channelid) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void setChannelState(Channel state) throws ServerBootedException, InvalidChannelException, InvalidSecretException, NestingLimitException;\n\nvoid removeChannel(int channelid) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nint addChannel(string name, int parent) throws ServerBootedException, InvalidChannelException, InvalidSecretException, NestingLimitException;\n\nvoid sendMessageChannel(int channelid, bool tree, string text) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void getACL(int channelid, out ACLList acls, out GroupList groups, out bool inherit) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void setACL(int channelid, ACLList acls, GroupList groups, bool inherit) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void addUserToGroup(int channelid, int session, string group) throws ServerBootedException, InvalidChannelException, InvalidSessionException, InvalidSecretException;\n\nidempotent void removeUserFromGroup(int channelid, int session, string group) throws ServerBootedException, InvalidChannelException, InvalidSessionException, InvalidSecretException;\n\nidempotent void redirectWhisperGroup(int session, string source, string target) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent NameMap getUserNames(IdList ids) throws ServerBootedException, InvalidSecretException;\n\nidempotent IdMap getUserIds(NameList names) throws ServerBootedException, InvalidSecretException;\n\nint registerUser(UserInfoMap info) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nvoid unregisterUser(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent void updateRegistration(int userid, UserInfoMap info) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent UserInfoMap getRegistration(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent NameMap getRegisteredUsers(string filter) throws ServerBootedException, InvalidSecretException;\n\nidempotent int verifyPassword(string name, string pw) throws ServerBootedException, InvalidSecretException;\n\nidempotent Texture getTexture(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent void setTexture(int userid, Texture tex) throws ServerBootedException, InvalidUserException, InvalidTextureException, InvalidSecretException;\n\nidempotent int getUptime() throws ServerBootedException, InvalidSecretException;\n\n idempotent void updateCertificate(string certificate, string privateKey, string passphrase) throws ServerBootedException, InvalidSecretException, InvalidInputDataException;\n \n idempotent void startListening(int userid, int channelid);\n \n idempotent void stopListening(int userid, int channelid);\n \n idempotent bool isListening(int userid, int channelid);\n \n idempotent IntList getListeningChannels(int userid);\n \n idempotent IntList getListeningUsers(int channelid);\n};\n\ninterface MetaCallback {\nvoid started(Server *srv);\n\nvoid stopped(Server *srv);\n};\nsequence<Server *> ServerList;\n\n[\"amd\"] interface Meta {\nidempotent Server *getServer(int id) throws InvalidSecretException;\n\nServer *newServer() throws InvalidSecretException;\n\nidempotent ServerList getBootedServers() throws InvalidSecretException;\n\nidempotent ServerList getAllServers() throws InvalidSecretException;\n\nidempotent ConfigMap getDefaultConf() throws InvalidSecretException;\n\nidempotent void getVersion(out int major, out int minor, out int patch, out string text);\n\nvoid addCallback(MetaCallback *cb) throws InvalidCallbackException, InvalidSecretException;\n\nvoid removeCallback(MetaCallback *cb) throws InvalidCallbackException, InvalidSecretException;\n\nidempotent int getUptime();\n\nidempotent string getSlice();\n\nidempotent Ice::SliceChecksumDict getSliceChecksums();\n};\n};\n")); + cb->ice_response(std::string("\n\n\n\n#include <Ice/SliceChecksumDict.ice>\nmodule Murmur\n{\n\n[\"python:seq:tuple\"] sequence<byte> NetAddress;\n\nstruct User {\nint session;\nint userid;\nbool mute;\nbool deaf;\nbool suppress;\nbool prioritySpeaker;\nbool selfMute;\nbool selfDeaf;\nbool recording;\nint channel;\nstring name;\nint onlinesecs;\nint bytespersec;\nint version;\nstring release;\nstring os;\nstring osversion;\nstring identity;\nstring context;\nstring comment;\nNetAddress address;\nbool tcponly;\nint idlesecs;\nfloat udpPing;\nfloat tcpPing;\n};\nsequence<int> IntList;\n\nstruct TextMessage {\nIntList sessions;\nIntList channels;\nIntList trees;\nstring text;\n};\n\nstruct Channel {\nint id;\nstring name;\nint parent;\nIntList links;\nstring description;\nbool temporary;\nint position;\n};\n\nstruct Group {\nstring name;\nbool inherited;\nbool inherit;\nbool inheritable;\nIntList add;\nIntList remove;\nIntList members;\n};\n\nconst int PermissionWrite = 0x01;\nconst int PermissionTraverse = 0x02;\nconst int PermissionEnter = 0x04;\nconst int PermissionSpeak = 0x08;\nconst int PermissionWhisper = 0x100;\nconst int PermissionMuteDeafen = 0x10;\nconst int PermissionMove = 0x20;\nconst int PermissionMakeChannel = 0x40;\nconst int PermissionMakeTempChannel = 0x400;\nconst int PermissionLinkChannel = 0x80;\nconst int PermissionTextMessage = 0x200;\nconst int PermissionKick = 0x10000;\nconst int PermissionBan = 0x20000;\nconst int PermissionRegister = 0x40000;\nconst int PermissionRegisterSelf = 0x80000;\nconst int ResetUserContent = 0x100000;\n\nstruct ACL {\nbool applyHere;\nbool applySubs;\nbool inherited;\nint userid;\nstring group;\nint allow;\nint deny;\n};\n\nstruct Ban {\nNetAddress address;\nint bits;\nstring name;\nstring hash;\nstring reason;\nint start;\nint duration;\n};\n\nstruct LogEntry {\nint timestamp;\nstring txt;\n};\nclass Tree;\nsequence<Tree> TreeList;\nenum ChannelInfo { ChannelDescription, ChannelPosition };\nenum UserInfo { UserName, UserEmail, UserComment, UserHash, UserPassword, UserLastActive, UserKDFIterations };\ndictionary<int, User> UserMap;\ndictionary<int, Channel> ChannelMap;\nsequence<Channel> ChannelList;\nsequence<User> UserList;\nsequence<Group> GroupList;\nsequence<ACL> ACLList;\nsequence<LogEntry> LogList;\nsequence<Ban> BanList;\nsequence<int> IdList;\nsequence<string> NameList;\ndictionary<int, string> NameMap;\ndictionary<string, int> IdMap;\nsequence<byte> Texture;\ndictionary<string, string> ConfigMap;\nsequence<string> GroupNameList;\nsequence<byte> CertificateDer;\nsequence<CertificateDer> CertificateList;\n\ndictionary<UserInfo, string> UserInfoMap;\n\nclass Tree {\nChannel c;\nTreeList children;\nUserList users;\n};\nexception MurmurException {};\nexception InvalidSessionException extends MurmurException {};\nexception InvalidChannelException extends MurmurException {};\nexception InvalidServerException extends MurmurException {};\nexception ServerBootedException extends MurmurException {};\nexception ServerFailureException extends MurmurException {};\nexception InvalidUserException extends MurmurException {};\nexception InvalidTextureException extends MurmurException {};\nexception InvalidCallbackException extends MurmurException {};\nexception InvalidSecretException extends MurmurException {};\nexception NestingLimitException extends MurmurException {};\nexception WriteOnlyException extends MurmurException {};\nexception InvalidInputDataException extends MurmurException {};\n\ninterface ServerCallback {\nidempotent void userConnected(User state);\nidempotent void userDisconnected(User state);\nidempotent void userStateChanged(User state);\nidempotent void userTextMessage(User state, TextMessage message);\nidempotent void channelCreated(Channel state);\nidempotent void channelRemoved(Channel state);\nidempotent void channelStateChanged(Channel state);\n};\n\nconst int ContextServer = 0x01;\nconst int ContextChannel = 0x02;\nconst int ContextUser = 0x04;\n\ninterface ServerContextCallback {\nidempotent void contextAction(string action, User usr, int session, int channelid);\n};\n\ninterface ServerAuthenticator {\nidempotent int authenticate(string name, string pw, CertificateList certificates, string certhash, bool certstrong, out string newname, out GroupNameList groups);\n\nidempotent bool getInfo(int id, out UserInfoMap info);\n\nidempotent int nameToId(string name);\n\nidempotent string idToName(int id);\n\nidempotent Texture idToTexture(int id);\n};\n\ninterface ServerUpdatingAuthenticator extends ServerAuthenticator {\nint registerUser(UserInfoMap info);\n\nint unregisterUser(int id);\n\nidempotent NameMap getRegisteredUsers(string filter);\n\nidempotent int setInfo(int id, UserInfoMap info);\n\nidempotent int setTexture(int id, Texture tex);\n};\n\n[\"amd\"] interface Server {\nidempotent bool isRunning() throws InvalidSecretException;\n\nvoid start() throws ServerBootedException, ServerFailureException, InvalidSecretException;\n\nvoid stop() throws ServerBootedException, InvalidSecretException;\n\nvoid delete() throws ServerBootedException, InvalidSecretException;\n\nidempotent int id() throws InvalidSecretException;\n\nvoid addCallback(ServerCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid removeCallback(ServerCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid setAuthenticator(ServerAuthenticator *auth) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nidempotent string getConf(string key) throws InvalidSecretException, WriteOnlyException;\n\nidempotent ConfigMap getAllConf() throws InvalidSecretException;\n\nidempotent void setConf(string key, string value) throws InvalidSecretException;\n\nidempotent void setSuperuserPassword(string pw) throws InvalidSecretException;\n\nidempotent LogList getLog(int first, int last) throws InvalidSecretException;\n\nidempotent int getLogLen() throws InvalidSecretException;\n\nidempotent UserMap getUsers() throws ServerBootedException, InvalidSecretException;\n\nidempotent ChannelMap getChannels() throws ServerBootedException, InvalidSecretException;\n\nidempotent CertificateList getCertificateList(int session) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent Tree getTree() throws ServerBootedException, InvalidSecretException;\n\nidempotent BanList getBans() throws ServerBootedException, InvalidSecretException;\n\nidempotent void setBans(BanList bans) throws ServerBootedException, InvalidSecretException;\n\nvoid kickUser(int session, string reason) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent User getState(int session) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent void setState(User state) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nvoid sendMessage(int session, string text) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nbool hasPermission(int session, int channelid, int perm) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nidempotent int effectivePermissions(int session, int channelid) throws ServerBootedException, InvalidSessionException, InvalidChannelException, InvalidSecretException;\n\nvoid addContextCallback(int session, string action, string text, ServerContextCallback *cb, int ctx) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nvoid removeContextCallback(ServerContextCallback *cb) throws ServerBootedException, InvalidCallbackException, InvalidSecretException;\n\nidempotent Channel getChannelState(int channelid) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void setChannelState(Channel state) throws ServerBootedException, InvalidChannelException, InvalidSecretException, NestingLimitException;\n\nvoid removeChannel(int channelid) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nint addChannel(string name, int parent) throws ServerBootedException, InvalidChannelException, InvalidSecretException, NestingLimitException;\n\nvoid sendMessageChannel(int channelid, bool tree, string text) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void getACL(int channelid, out ACLList acls, out GroupList groups, out bool inherit) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void setACL(int channelid, ACLList acls, GroupList groups, bool inherit) throws ServerBootedException, InvalidChannelException, InvalidSecretException;\n\nidempotent void addUserToGroup(int channelid, int session, string group) throws ServerBootedException, InvalidChannelException, InvalidSessionException, InvalidSecretException;\n\nidempotent void removeUserFromGroup(int channelid, int session, string group) throws ServerBootedException, InvalidChannelException, InvalidSessionException, InvalidSecretException;\n\nidempotent void redirectWhisperGroup(int session, string source, string target) throws ServerBootedException, InvalidSessionException, InvalidSecretException;\n\nidempotent NameMap getUserNames(IdList ids) throws ServerBootedException, InvalidSecretException;\n\nidempotent IdMap getUserIds(NameList names) throws ServerBootedException, InvalidSecretException;\n\nint registerUser(UserInfoMap info) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nvoid unregisterUser(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent void updateRegistration(int userid, UserInfoMap info) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent UserInfoMap getRegistration(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent NameMap getRegisteredUsers(string filter) throws ServerBootedException, InvalidSecretException;\n\nidempotent int verifyPassword(string name, string pw) throws ServerBootedException, InvalidSecretException;\n\nidempotent Texture getTexture(int userid) throws ServerBootedException, InvalidUserException, InvalidSecretException;\n\nidempotent void setTexture(int userid, Texture tex) throws ServerBootedException, InvalidUserException, InvalidTextureException, InvalidSecretException;\n\nidempotent int getUptime() throws ServerBootedException, InvalidSecretException;\n\n idempotent void updateCertificate(string certificate, string privateKey, string passphrase) throws ServerBootedException, InvalidSecretException, InvalidInputDataException;\n \n idempotent void startListening(int userid, int channelid);\n \n idempotent void stopListening(int userid, int channelid);\n \n idempotent bool isListening(int userid, int channelid);\n \n idempotent IntList getListeningChannels(int userid);\n \n idempotent IntList getListeningUsers(int channelid);\n \n idempotent void sendWelcomeMessage(IdList receiverUserIDs);\n};\n\ninterface MetaCallback {\nvoid started(Server *srv);\n\nvoid stopped(Server *srv);\n};\nsequence<Server *> ServerList;\n\n[\"amd\"] interface Meta {\nidempotent Server *getServer(int id) throws InvalidSecretException;\n\nServer *newServer() throws InvalidSecretException;\n\nidempotent ServerList getBootedServers() throws InvalidSecretException;\n\nidempotent ServerList getAllServers() throws InvalidSecretException;\n\nidempotent ConfigMap getDefaultConf() throws InvalidSecretException;\n\nidempotent void getVersion(out int major, out int minor, out int patch, out string text);\n\nvoid addCallback(MetaCallback *cb) throws InvalidCallbackException, InvalidSecretException;\n\nvoid removeCallback(MetaCallback *cb) throws InvalidCallbackException, InvalidSecretException;\n\nidempotent int getUptime();\n\nidempotent string getSlice();\n\nidempotent Ice::SliceChecksumDict getSliceChecksums();\n};\n};\n")); } diff --git a/src/murmur/RPC.cpp b/src/murmur/RPC.cpp index d6f9e74ec..cb976c68b 100644 --- a/src/murmur/RPC.cpp +++ b/src/murmur/RPC.cpp @@ -570,6 +570,13 @@ void Server::stopListeningToChannel(ServerUser *user, Channel *cChannel) { sendAll(mpus); } +void Server::sendWelcomeMessageTo(ServerUser *user) { + MumbleProto::ServerConfig mpsc; + mpsc.set_welcome_text(qsWelcomeText.toUtf8().data()); + + sendMessage(user, mpsc); +} + void Meta::connectListener(QObject *obj) { connect(this, SIGNAL(started(Server *)), obj, SLOT(started(Server *))); connect(this, SIGNAL(stopped(Server *)), obj, SLOT(stopped(Server *))); diff --git a/src/murmur/Server.h b/src/murmur/Server.h index 17418fd55..e3cd1daf9 100644 --- a/src/murmur/Server.h +++ b/src/murmur/Server.h @@ -353,6 +353,7 @@ public: void clearTempGroups(User *user, Channel *cChannel = nullptr, bool recurse = true); void startListeningToChannel(ServerUser *user, Channel *cChannel); void stopListeningToChannel(ServerUser *user, Channel *cChannel); + void sendWelcomeMessageTo(ServerUser *user); signals: void registerUserSig(int &, const QMap< int, QString > &); void unregisterUserSig(int &, int); |