mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 12:49:24 +01:00
Remove the '(XX more messages)' when the next message is sent immediately after
It's pointless and looks stupid. It will look even more stupid when we enable multiline, because the suffixes will be in the middle of the concatenated message.
This commit is contained in:
parent
f98542e884
commit
11e79e44c5
@ -999,10 +999,17 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
# (which is used like a stack)
|
# (which is used like a stack)
|
||||||
chunks.reverse()
|
chunks.reverse()
|
||||||
|
|
||||||
|
instant = conf.get(conf.supybot.reply.mores.instant,
|
||||||
|
channel=target, network=self.irc.network)
|
||||||
|
|
||||||
msgs = []
|
msgs = []
|
||||||
for (i, chunk) in enumerate(chunks):
|
for (i, chunk) in enumerate(chunks):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
pass # last message, no suffix to add
|
pass # last message, no suffix to add
|
||||||
|
elif len(chunks) - i < instant:
|
||||||
|
# one of the first messages, and the next one will
|
||||||
|
# also be sent immediately, so no suffix
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
if i == 1:
|
if i == 1:
|
||||||
more = _('more message')
|
more = _('more message')
|
||||||
@ -1012,8 +1019,6 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
chunk = '%s %s' % (chunk, n)
|
chunk = '%s %s' % (chunk, n)
|
||||||
msgs.append(_makeReply(self, msg, chunk, **replyArgs))
|
msgs.append(_makeReply(self, msg, chunk, **replyArgs))
|
||||||
|
|
||||||
instant = conf.get(conf.supybot.reply.mores.instant,
|
|
||||||
channel=target, network=self.irc.network)
|
|
||||||
while instant > 1 and msgs:
|
while instant > 1 and msgs:
|
||||||
instant -= 1
|
instant -= 1
|
||||||
response = msgs.pop()
|
response = msgs.pop()
|
||||||
|
@ -540,28 +540,28 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
|||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
"eval 'foo '*300",
|
"eval 'foo '*300",
|
||||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
||||||
self.assertNoResponse(' ')
|
self.assertNoResponse(" ", timeout=0.1)
|
||||||
|
|
||||||
with conf.supybot.reply.mores.instant.context(2):
|
with conf.supybot.reply.mores.instant.context(2):
|
||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
"eval 'foo '*300",
|
"eval 'foo '*300",
|
||||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
"'" + "foo " * 110)
|
||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
" ",
|
" ",
|
||||||
"foo " * 111 + "\x02(1 more message)\x02")
|
"foo " * 111 + "\x02(1 more message)\x02")
|
||||||
self.assertNoResponse(" ")
|
self.assertNoResponse(" ", timeout=0.1)
|
||||||
|
|
||||||
with conf.supybot.reply.mores.instant.context(3):
|
with conf.supybot.reply.mores.instant.context(3):
|
||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
"eval 'foo '*300",
|
"eval 'foo '*300",
|
||||||
"'" + "foo " * 110 + " \x02(2 more messages)\x02")
|
"'" + "foo " * 110)
|
||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
" ",
|
" ",
|
||||||
"foo " * 111 + "\x02(1 more message)\x02")
|
"foo " * 110 + "foo")
|
||||||
self.assertResponse(
|
self.assertResponse(
|
||||||
" ",
|
" ",
|
||||||
" " + "foo " * 79 + "'")
|
" " + "foo " * 79 + "'")
|
||||||
self.assertNoResponse(" ")
|
self.assertNoResponse(" ", timeout=0.1)
|
||||||
|
|
||||||
def testClientTagReply(self):
|
def testClientTagReply(self):
|
||||||
self.irc.addCallback(self.First(self.irc))
|
self.irc.addCallback(self.First(self.irc))
|
||||||
|
Loading…
Reference in New Issue
Block a user