Fix smartlog function.

This commit is contained in:
Krytarik Raido 2021-10-10 01:04:04 +02:00
parent 5231ed21a8
commit 051a76fa2e

View File

@ -777,7 +777,7 @@ class Ircd(object):
if logFunction:
if ct.registryValue('useColorForAnnounces', channel=channel, network=irc.network):
if useSmartLog:
logFunction(irc, '"%s"' % message)
logFunction('"%s"' % message)
else:
logFunction(irc, channel, '[%s] [#%s %s %s] marked by %s: %s' % (
ircutils.bold(channel), ircutils.mircColor(uid, 'yellow', 'black'),
@ -785,7 +785,7 @@ class Ircd(object):
ircutils.mircColor(mask, 'light blue'), prefix.split('!')[0], message))
else:
if useSmartLog:
logFunction(irc, channel, '"%s"' % message)
logFunction('"%s"' % message)
else:
logFunction(irc, channel, '[%s] [#%s +%s %s] marked by %s: %s' % (
channel, uid, kind, mask, prefix.split('!')[0], message))
@ -919,7 +919,7 @@ class Ircd(object):
if logFunction:
if ct.registryValue('useColorForAnnounces', channel=channel, network=irc.network):
if useSmartLog:
logFunction(irc, '[%s] [#%s %s %s] by %s: %s' % (
logFunction('[%s] [#%s %s %s] by %s: %s' % (
ircutils.bold(channel), ircutils.mircColor(str(uid), 'yellow', 'black'),
ircutils.bold(ircutils.mircColor('+%s' % kind, 'red')),
ircutils.mircColor(mask, 'light blue'), prefix.split('!')[0], reason))
@ -930,7 +930,7 @@ class Ircd(object):
ircutils.mircColor(mask, 'light blue'), prefix.split('!')[0], reason))
else:
if useSmartLog:
logFunction(irc, channel, '[%s] [#%s +%s %s] by %s: %s' % (
logFunction('[%s] [#%s +%s %s] by %s: %s' % (
channel, uid, kind, mask, prefix.split('!')[0], reason))
else:
logFunction(irc, channel, '[%s] [#%s +%s %s] edited by %s: %s' % (
@ -1624,9 +1624,9 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
if item:
f = None
mm = []
useEAM = self.registryValue(
'announceInTimeEditAndMark', channel=item.channel, network=irc.network) and not getDuration(seconds) == -1.0 and reason and len(reason) > 0
def ff(self, m):
useEAM = self.registryValue('announceInTimeEditAndMark', channel=item.channel, network=irc.network) \
and not getDuration(seconds) == -1.0 and reason and len(reason) > 0
def ff(m):
mm.append(m)
if len(mm) == 2:
lc(irc, item.channel, ' '.join(mm))