Skip to content
Permalink
Browse files

Merge PR #3451: Add configurable private text message notification

  • Loading branch information...
davidebeatrici committed Jul 8, 2018
2 parents 07c8e00 + 7fb1e50 commit 91f5e1cb04028d7120dad9f8f9fd965de6de156b
Showing with 22 additions and 12 deletions.
  1. +3 −2 src/mumble/Log.cpp
  2. +2 −2 src/mumble/Log.h
  3. +4 −1 src/mumble/Messages.cpp
  4. +1 −0 src/mumble/Settings.cpp
  5. +12 −7 src/mumble/mumble_en.ts
@@ -215,7 +215,7 @@ const Log::MsgType Log::msgOrder[] = {
ChannelJoin, ChannelLeave,
ChannelJoinConnect, ChannelLeaveDisconnect,
PermissionDenied,
TextMessage
TextMessage, PrivateTextMessage
};

const char *Log::msgNames[] = {
@@ -246,7 +246,8 @@ const char *Log::msgNames[] = {
QT_TRANSLATE_NOOP("Log", "You Joined Channel"),
QT_TRANSLATE_NOOP("Log", "You Joined Channel (moved)"),
QT_TRANSLATE_NOOP("Log", "User connected and entered channel"),
QT_TRANSLATE_NOOP("Log", "User left channel and disconnected")
QT_TRANSLATE_NOOP("Log", "User left channel and disconnected"),
QT_TRANSLATE_NOOP("Log", "Private text message")
};

QString Log::msgName(MsgType t) const {
@@ -44,10 +44,10 @@ class Log : public QObject {
Q_OBJECT
Q_DISABLE_COPY(Log)
public:
enum MsgType { DebugInfo, CriticalError, Warning, Information, ServerConnected, ServerDisconnected, UserJoin, UserLeave, Recording, YouKicked, UserKicked, SelfMute, OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther, ChannelJoin, ChannelLeave, PermissionDenied, TextMessage, SelfUnmute, SelfDeaf, SelfUndeaf, UserRenamed, SelfChannelJoin, SelfChannelJoinOther, ChannelJoinConnect, ChannelLeaveDisconnect };
enum MsgType { DebugInfo, CriticalError, Warning, Information, ServerConnected, ServerDisconnected, UserJoin, UserLeave, Recording, YouKicked, UserKicked, SelfMute, OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther, ChannelJoin, ChannelLeave, PermissionDenied, TextMessage, SelfUnmute, SelfDeaf, SelfUndeaf, UserRenamed, SelfChannelJoin, SelfChannelJoinOther, ChannelJoinConnect, ChannelLeaveDisconnect, PrivateTextMessage };
enum LogColorType { Time, Server, Privilege, Source, Target };
static const MsgType firstMsgType = DebugInfo;
static const MsgType lastMsgType = ChannelLeaveDisconnect;
static const MsgType lastMsgType = PrivateTextMessage;

// Display order in settingsscreen, allows to insert new events without breaking config-compatibility with older versions.
static const MsgType msgOrder[];
@@ -700,16 +700,19 @@ void MainWindow::msgTextMessage(const MumbleProto::TextMessage &msg) {

const QString &plainName = pSrc ? pSrc->qsName : tr("Server", "message from");
const QString &name = pSrc ? Log::formatClientUser(pSrc, Log::Source) : tr("Server", "message from");
bool privateMessage = false;

if (msg.tree_id_size() > 0) {
target += tr("(Tree) ");
} else if (msg.channel_id_size() > 0) {
target += tr("(Channel) ");
} else if (msg.session_size() > 0) {
target += tr("(Private) ");
privateMessage = true;
}

g.l->log(Log::TextMessage, tr("%2%1: %3").arg(name).arg(target).arg(u8(msg.message())),
g.l->log(privateMessage ? Log::PrivateTextMessage : Log::TextMessage,
tr("%2%1: %3").arg(name).arg(target).arg(u8(msg.message())),
tr("Message from %1").arg(plainName));
}

@@ -423,6 +423,7 @@ Settings::Settings() {
qmMessageSounds[Log::ServerConnected] = QLatin1String(":/ServerConnected.ogg");
qmMessageSounds[Log::ServerDisconnected] = QLatin1String(":/ServerDisconnected.ogg");
qmMessageSounds[Log::TextMessage] = QLatin1String(":/TextMessage.ogg");
qmMessageSounds[Log::PrivateTextMessage] = qmMessageSounds[Log::TextMessage];
qmMessageSounds[Log::ChannelJoin] = QLatin1String(":/UserJoinedChannel.ogg");
qmMessageSounds[Log::ChannelLeave] = QLatin1String(":/UserLeftChannel.ogg");
qmMessageSounds[Log::ChannelJoinConnect] = qmMessageSounds[Log::ChannelJoin];
@@ -4099,6 +4099,11 @@ This field describes the size of an LCD device. The size is given either in pixe
<source>User left channel and disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Private text message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>the server</source>
@@ -4149,7 +4154,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<context>
<name>LogConfig</name>
<message>
<location line="-498"/>
<location line="-499"/>
<source>Toggle console for %1 events</source>
<translation type="unfinished"></translation>
</message>
@@ -6203,7 +6208,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="+4"/>
<source>(Tree) </source>
<translation type="unfinished"></translation>
</message>
@@ -6218,7 +6223,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="+5"/>
<source>%2%1: %3</source>
<translation type="unfinished"></translation>
</message>
@@ -6248,7 +6253,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-461"/>
<location line="-464"/>
<source>You were unmuted by %1.</source>
<translation type="unfinished"></translation>
</message>
@@ -6283,12 +6288,12 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+364"/>
<location line="+367"/>
<source>Unable to find matching CELT codecs with other clients. You will not be able to talk to all users.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-430"/>
<location line="-433"/>
<source>You were muted and deafened by %1.</source>
<oldsource>You were deafened by %1.</oldsource>
<translation type="unfinished"></translation>
@@ -6344,7 +6349,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+129"/>
<location line="+132"/>
<source>Message from %1</source>
<translation type="unfinished"></translation>
</message>

0 comments on commit 91f5e1c

Please sign in to comment.
You can’t perform that action at this time.