mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-25 20:41:19 -05:00
Improve handling of replies.
This commit is contained in:
parent
acde82892a
commit
4d1e5e6b53
20
plugin.py
20
plugin.py
@ -1535,7 +1535,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
allowed = True
|
allowed = True
|
||||||
break
|
break
|
||||||
if allowed:
|
if allowed:
|
||||||
irc.queueMsg(ircmsgs.privmsg(msg.nick, server.weblink()))
|
irc.reply(server.weblink(), private=True)
|
||||||
else:
|
else:
|
||||||
irc.errorNoCapability('#channel,op')
|
irc.errorNoCapability('#channel,op')
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
@ -1548,9 +1548,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
returns various statistics about channel activity"""
|
returns various statistics about channel activity"""
|
||||||
c = self.getChan(irc, channel)
|
c = self.getChan(irc, channel)
|
||||||
messages = c.summary(self.getDb(irc.network))
|
messages = c.summary(self.getDb(irc.network))
|
||||||
for message in messages:
|
irc.replies(messages, onlyPrefixFirst=True, private=True)
|
||||||
irc.queueMsg(ircmsgs.privmsg(msg.nick, message))
|
|
||||||
irc.replySuccess()
|
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
self._tickle(irc)
|
self._tickle(irc)
|
||||||
summary = wrap(summary, ['op', 'channel'])
|
summary = wrap(summary, ['op', 'channel'])
|
||||||
@ -1579,10 +1577,10 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
for prop in props:
|
for prop in props:
|
||||||
newChan = getWrapper('%s.%s.%s' % (namespace, prop[0], newChannel))
|
newChan = getWrapper('%s.%s.%s' % (namespace, prop[0], newChannel))
|
||||||
newChan.set(prop[1])
|
newChan.set(prop[1])
|
||||||
|
irc.replySuccess()
|
||||||
else:
|
else:
|
||||||
for m in msgs:
|
for m in msgs:
|
||||||
irc.queueMsg(m)
|
irc.queueMsg(m)
|
||||||
irc.replySuccess()
|
|
||||||
else:
|
else:
|
||||||
irc.reply("%s uses global's settings" % channel)
|
irc.reply("%s uses global's settings" % channel)
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
@ -1681,14 +1679,13 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
i = self.getIrc(irc)
|
i = self.getIrc(irc)
|
||||||
results = i.info(irc, uid, msg.prefix, self.getDb(irc.network))
|
results = i.info(irc, uid, msg.prefix, self.getDb(irc.network))
|
||||||
if len(results):
|
if len(results):
|
||||||
|
msgs = []
|
||||||
|
for message in results:
|
||||||
|
msgs.append(message[1])
|
||||||
if self.registryValue('allowPublicInfo', channel=results[0][0], network=irc.network):
|
if self.registryValue('allowPublicInfo', channel=results[0][0], network=irc.network):
|
||||||
msgs = []
|
|
||||||
for message in results:
|
|
||||||
msgs.append(message[1])
|
|
||||||
irc.replies(msgs, None, None, True, None)
|
irc.replies(msgs, None, None, True, None)
|
||||||
else:
|
else:
|
||||||
for message in results:
|
irc.replies(msgs, onlyPrefixFirst=True, private=True)
|
||||||
irc.queueMsg(ircmsgs.privmsg(msg.nick, message[1]))
|
|
||||||
else:
|
else:
|
||||||
irc.reply('item not found or not enough rights to see information')
|
irc.reply('item not found or not enough rights to see information')
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
@ -1829,8 +1826,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
if not flood:
|
if not flood:
|
||||||
irc.reply(', '.join(results), private=True)
|
irc.reply(', '.join(results), private=True)
|
||||||
else:
|
else:
|
||||||
for result in results:
|
irc.replies(results, onlyPrefixFirst=True, private=True)
|
||||||
irc.queueMsg(ircmsgs.privmsg(msg.nick, result))
|
|
||||||
else:
|
else:
|
||||||
irc.reply('nothing found')
|
irc.reply('nothing found')
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user