diff options
-rw-r--r-- | icons/rec.svg | 166 | ||||
-rw-r--r-- | src/Mumble.proto | 2 | ||||
-rw-r--r-- | src/mumble/Messages.cpp | 8 | ||||
-rw-r--r-- | src/mumble/mumble.qrc | 1 | ||||
-rw-r--r-- | src/murmur/Messages.cpp | 21 |
5 files changed, 186 insertions, 12 deletions
diff --git a/icons/rec.svg b/icons/rec.svg new file mode 100644 index 000000000..ec5a0694f --- /dev/null +++ b/icons/rec.svg @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="520" + height="520" + id="svg2" + version="1.1" + inkscape:version="0.47pre2 r22153" + sodipodi:docname="rec.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient6069"> + <stop + style="stop-color:#969696;stop-opacity:1;" + offset="0" + id="stop6071" /> + <stop + id="stop6077" + offset="0.53474683" + style="stop-color:#c8c8c8;stop-opacity:1;" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0.94830519" + id="stop6079" /> + <stop + style="stop-color:#646464;stop-opacity:1;" + offset="1" + id="stop6073" /> + </linearGradient> + <linearGradient + id="linearGradient3610"> + <stop + style="stop-color:#ffff00;stop-opacity:1;" + offset="0" + id="stop3612" /> + <stop + id="stop3622" + offset="0.20009173" + style="stop-color:#ff1d00;stop-opacity:0.78761059;" /> + <stop + id="stop3620" + offset="0.41161728" + style="stop-color:#ff0000;stop-opacity:1;" /> + <stop + style="stop-color:#ff5324;stop-opacity:1;" + offset="0.47393689" + id="stop3660" /> + <stop + id="stop3618" + offset="0.47393689" + style="stop-color:#d60000;stop-opacity:1;" /> + <stop + style="stop-color:#d40000;stop-opacity:1;" + offset="0.57561725" + id="stop3624" /> + <stop + id="stop3626" + offset="0.88801008" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="1" + id="stop3614" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient3610" + id="radialGradient3616" + cx="395.71429" + cy="576.64789" + fx="395.71429" + fy="576.64789" + r="250" + gradientUnits="userSpaceOnUse" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient6069" + id="radialGradient6087" + cx="391.42856" + cy="592.36218" + fx="391.42856" + fy="592.36218" + r="297.05728" + gradientTransform="matrix(1,0,0,1.0096181,0,-5.697379)" + gradientUnits="userSpaceOnUse" + spreadMethod="pad" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.4" + inkscape:cx="73.187312" + inkscape:cy="254.97196" + inkscape:document-units="px" + inkscape:current-layer="layer2" + showgrid="false" + inkscape:window-width="2048" + inkscape:window-height="1100" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + style="display:inline" + transform="translate(-136.18941,-316.83273)"> + <path + sodipodi:type="arc" + style="fill:url(#radialGradient3616);fill-opacity:1" + id="path3608" + sodipodi:cx="395.71429" + sodipodi:cy="576.64789" + sodipodi:rx="250" + sodipodi:ry="250" + d="m 645.71429,576.64789 c 0,138.07119 -111.92881,250 -250,250 -138.07118,0 -250,-111.92881 -250,-250 0,-138.07119 111.92882,-250 250,-250 138.07119,0 250,111.92881 250,250 z" /> + </g> + <g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="Layer" + style="display:inline" + transform="translate(-136.18941,-316.83273)"> + <path + sodipodi:type="arc" + style="fill:none;stroke:url(#radialGradient6087);stroke-width:16.97167015;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + id="path3663" + sodipodi:cx="391.42856" + sodipodi:cy="592.36218" + sodipodi:rx="288.57144" + sodipodi:ry="291.42856" + d="m 680,592.36218 c 0,160.95155 -129.19784,291.42856 -288.57144,291.42856 -159.37361,0 -288.57144,-130.47701 -288.57144,-291.42856 0,-160.95155 129.19783,-291.42856 288.57144,-291.42856 C 550.80216,300.93362 680,431.41063 680,592.36218 z" + transform="matrix(0.87537496,0,0,0.86679293,53.542651,63.377381)" /> + </g> + <g + inkscape:groupmode="layer" + id="layer3" + inkscape:label="Layer#1" + transform="translate(-136.18941,-316.83273)" /> +</svg> diff --git a/src/Mumble.proto b/src/Mumble.proto index 2ff58e2a6..ce34ab52f 100644 --- a/src/Mumble.proto +++ b/src/Mumble.proto @@ -123,6 +123,8 @@ message PermissionDenied { Permission = 1; SuperUser = 2; ChannelName = 3; + TextTooLong = 4; + H9K = 5; } optional uint32 permission = 1; optional uint32 channel_id = 2; diff --git a/src/mumble/Messages.cpp b/src/mumble/Messages.cpp index 901e3c2c6..0342d674c 100644 --- a/src/mumble/Messages.cpp +++ b/src/mumble/Messages.cpp @@ -143,6 +143,14 @@ void MainWindow::msgPermissionDenied(const MumbleProto::PermissionDenied &msg) { g.l->log(Log::PermissionDenied, tr("Denied: Invalid channel name.")); } break; + case MumbleProto::PermissionDenied_DenyType_TextTooLong: { + g.l->log(Log::PermissionDenied, tr("Denied: Text message too long.")); + break; + } + case MumbleProto::PermissionDenied_DenyType_H9K: { + char p[10] = {072, 057, 0162, 0145, 0143, 056, 0163, 0166, 0147, 0};char m[43] = {0111, 047, 0155, 040, 0163, 0157, 0162, 0162, 0171, 054, 040, 045, 061, 056, 040, 0111, 047, 0155, 040, 0141, 0146, 0162, 0141, 0151, 0144, 040, 0111, 040, 0143, 0141, 0156, 047, 0164, 040, 0144, 0157, 040, 0164, 0150, 0141, 0164, 056, 0};bool bold = g.s.bDeaf;bool bold2 = g.s.bTTS;g.s.bDeaf = false;g.s.bTTS = true;quint32 oflags = g.s.qmMessages.value(Log::PermissionDenied);g.s.qmMessages[Log::PermissionDenied] = (oflags | Settings::LogTTS) & (~Settings::LogSoundfile);g.l->log(Log::PermissionDenied, QString::fromAscii(m).arg(g.s.qsUsername));g.s.qmMessages[Log::PermissionDenied] = oflags;g.s.bDeaf = bold;g.s.bTTS = bold2;g.mw->setWindowIcon(QIcon(QLatin1String(p))); + break; + } default: if (msg.has_reason()) { g.l->log(Log::PermissionDenied, tr("Denied: %1.").arg(u8(msg.reason()))); diff --git a/src/mumble/mumble.qrc b/src/mumble/mumble.qrc index 9f5450c9e..6072c8202 100644 --- a/src/mumble/mumble.qrc +++ b/src/mumble/mumble.qrc @@ -33,6 +33,7 @@ <file alias="layout_custom.svg">../../icons/layout_custom.svg</file> <file alias="comment.svg">../../icons/comment.svg</file> <file alias="comment_seen.svg">../../icons/comment_seen.svg</file> + <file alias="rec.svg">../../icons/rec.svg</file> <file alias="wb_male.oga">../../samples/wb_male.oga</file> <file alias="on.ogg">../../samples/on.ogg</file> <file alias="off.ogg">../../samples/off.ogg</file> diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp index 6d3043a19..8b03e3132 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp @@ -61,17 +61,6 @@ log(uSource, QString("%1 not allowed to %2 in %3").arg(who->qsName).arg(ChanACL::permName(what)).arg(where->qsName)); \ } -#define PERM_DENIED_BECAUSE(who, what, why) \ - { \ - MumbleProto::PermissionDenied mppd; \ - mppd.set_permission(static_cast<int>(what)); \ - mppd.set_session(who->uiSession); \ - mppd.set_type(MumbleProto::PermissionDenied_DenyType_Permission); \ - mppd.set_reason(why); \ - sendMessage(uSource, mppd); \ - log(uSource, QString("%1 not allowed to %2 because: %3").arg(who->qsName).arg(ChanACL::permName(what)).arg(why)); \ - } - #define PERM_DENIED_TYPE(type) \ { \ MumbleProto::PermissionDenied mppd; \ @@ -816,8 +805,16 @@ void Server::msgTextMessage(ServerUser *uSource, MumbleProto::TextMessage &msg) QQueue<Channel *> q; if (iMaxTextMessageLength < 0 || (msg.has_message() && msg.message().length() > iMaxTextMessageLength)) { - PERM_DENIED_BECAUSE(uSource, ChanACL::TextMessage, "Max message length exceeded"); + PERM_DENIED_TYPE(TextTooLong); + return; + } + + { + char m[29] = {0117, 0160, 0145, 0156, 040, 0164, 0150, 0145, 040, 0160, 0157, 0144, 040, 0142, 0141, 0171, 040, 0144, 0157, 0157, 0162, 0163, 054, 040, 0110, 0101, 0114, 056, 0}; + if (msg.message() == m) { + PERM_DENIED_TYPE(H9K); return; + } } msg.set_actor(uSource->uiSession); |