Skip to content
Permalink
Browse files

Merge PR #3349: Add configurable "You joined channel" and "You have b…

…een moved to channel by..." messages
  • Loading branch information...
davidebeatrici committed Mar 1, 2018
2 parents 3cd8b98 + a02084a commit 651e4d0d2047a5dee72ee64934738c975a3f8261
Showing with 42 additions and 22 deletions.
  1. +4 −1 src/mumble/Log.cpp
  2. +2 −2 src/mumble/Log.h
  3. +6 −4 src/mumble/Messages.cpp
  4. +30 −15 src/mumble/mumble_en.ts
@@ -203,6 +203,7 @@ const Log::MsgType Log::msgOrder[] = {
UserRenamed,
SelfMute, SelfUnmute, SelfDeaf, SelfUndeaf,
OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther,
SelfChannelJoin, SelfChannelJoinOther,
ChannelJoin, ChannelLeave,
PermissionDenied,
TextMessage
@@ -232,7 +233,9 @@ const char *Log::msgNames[] = {
QT_TRANSLATE_NOOP("Log", "You self-unmuted"),
QT_TRANSLATE_NOOP("Log", "You self-deafened"),
QT_TRANSLATE_NOOP("Log", "You self-undeafened"),
QT_TRANSLATE_NOOP("Log", "User renamed")
QT_TRANSLATE_NOOP("Log", "User renamed"),
QT_TRANSLATE_NOOP("Log", "You Joined Channel"),
QT_TRANSLATE_NOOP("Log", "You Joined Channel (moved)"),
};

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 };
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 };
enum LogColorType { Time, Server, Privilege, Source, Target };
static const MsgType firstMsgType = DebugInfo;
static const MsgType lastMsgType = UserRenamed;
static const MsgType lastMsgType = SelfChannelJoinOther;

// Display order in settingsscreen, allows to insert new events without breaking config-compatibility with older versions.
static const MsgType msgOrder[];
@@ -471,11 +471,12 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {

Channel *old = pDst->cChannel;
if (c != old) {
bool log = pSelf && !((pDst == pSelf) && (pSrc == pSelf));

if (log) {
if (pSelf) {
if (pDst == pSelf) {
g.l->log(Log::ChannelJoin, tr("You were moved to %1 by %2.").arg(Log::formatChannel(c)).arg(Log::formatClientUser(pSrc, Log::Source)));
if (pSrc == pSelf)
g.l->log(Log::SelfChannelJoin, tr("You joined %1.").arg(Log::formatChannel(c)));
else
g.l->log(Log::SelfChannelJoinOther, tr("You were moved to %1 by %2.").arg(Log::formatChannel(c)).arg(Log::formatClientUser(pSrc, Log::Source)));
} else if (pDst->cChannel == pSelf->cChannel) {
if (pDst == pSrc)
g.l->log(Log::ChannelLeave, tr("%1 moved to %2.").arg(Log::formatClientUser(pDst, Log::Target)).arg(Log::formatChannel(c)));
@@ -493,6 +494,7 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {
qsDesiredChannel = c->getPath();
}

bool log = pSelf && !((pDst == pSelf) && (pSrc == pSelf));
if (log && (pDst != pSelf) && (pDst->cChannel == pSelf->cChannel)) {
if (pDst == pSrc)
g.l->log(Log::ChannelJoin, tr("%1 entered channel.").arg(Log::formatClientUser(pDst, Log::Target)));
@@ -3927,7 +3927,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<context>
<name>Log</name>
<message>
<location filename="Log.cpp" line="+212"/>
<location filename="Log.cpp" line="+213"/>
<source>Debug</source>
<translation type="unfinished"></translation>
</message>
@@ -4046,6 +4046,16 @@ This field describes the size of an LCD device. The size is given either in pixe
<source>User renamed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>You Joined Channel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>You Joined Channel (moved)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>the server</source>
@@ -4096,7 +4106,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<context>
<name>LogConfig</name>
<message>
<location line="-479"/>
<location line="-482"/>
<source>Toggle console for %1 events</source>
<translation type="unfinished"></translation>
</message>
@@ -5875,7 +5885,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<location line="+26"/>
<source>%1 moved to %2.</source>
<translation type="unfinished"></translation>
</message>
@@ -5885,12 +5895,12 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<location line="+18"/>
<source>%1 moved in from %2 by %3.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-200"/>
<location line="-202"/>
<source>%1 is now muted and deafened.</source>
<translation type="unfinished"></translation>
</message>
@@ -6092,12 +6102,17 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+83"/>
<location line="+75"/>
<source>You joined %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>You moved %1 to %2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<location line="+19"/>
<source>%1 is recording</source>
<translation type="unfinished"></translation>
</message>
@@ -6164,7 +6179,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-517"/>
<location line="-519"/>
<source>You were unmuted by %1.</source>
<translation type="unfinished"></translation>
</message>
@@ -6199,18 +6214,18 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+420"/>
<location line="+422"/>
<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="-486"/>
<location line="-488"/>
<source>You were muted and deafened by %1.</source>
<oldsource>You were deafened by %1.</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+176"/>
<location line="+178"/>
<source>You were kicked from the server by %1: %2.</source>
<translation type="unfinished"></translation>
</message>
@@ -6230,17 +6245,17 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-79"/>
<location line="-80"/>
<source>You were moved to %1 by %2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<location line="+21"/>
<source>%1 entered channel.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-409"/>
<location line="-411"/>
<source>Server connection rejected: %1.</source>
<translation type="unfinished"></translation>
</message>
@@ -6250,7 +6265,7 @@ Otherwise abort and check your certificate and username.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+269"/>
<location line="+271"/>
<source>%1 renamed to %2.</source>
<translation type="unfinished"></translation>
</message>

0 comments on commit 651e4d0

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