diff -uNr a/blatta/lib/client.py b/blatta/lib/client.py --- a/blatta/lib/client.py ce97a842df4d7c328976ca4dcd0e99e9ff0c5e56fba68ecb094055089b81a35c303b492fbab33116fd5be2213d75976259f7a947e7e4e538ba273c7d42698125 +++ b/blatta/lib/client.py ae28c098e89d25444fbd5fd93b6031d40ce4cef4ace438a887a6837fafde32137c304766a672b58898e36b75f5e8e0b784f58a0803994539d2b8c41cefe187d1 @@ -42,10 +42,9 @@ def message_from_station(self, msg): targetname = self.server.channel_name if msg.command == BROADCAST else self.nickname pest_prefix = msg.prefix if msg.prefix else msg.speaker - formatted_message = ":%s PRIVMSG %s :%s%s" % ( + formatted_message = ":%s PRIVMSG %s :%s" % ( pest_prefix, targetname, - msg.warning if msg.warning else "", msg.body ) self.__writebuffer += formatted_message + "\r\n" @@ -537,7 +536,7 @@ self.message(":%s %s" % (self.server.name, msg)) def pest_reply(self, msg): - self.message(":Pest NOTICE %s :%s" % (self.nickname, msg)) + self.message(":Pest NOTICE %s :%s" % (self.server.channel_name, msg)) def reply_403(self, channel): self.reply("403 %s %s :No such channel" % (self.nickname, channel)) diff -uNr a/blatta/lib/message.py b/blatta/lib/message.py --- a/blatta/lib/message.py eb3f3ec3fa23e3f350b870585fdbe7ccb548b4b4a266699f943cd97148d4130495d98399f73fa7e8466c61655ea5bcfee005d1ef07c8fae66ee91640b9bf0444 +++ b/blatta/lib/message.py 9d70f920b8f62bcbc311319dfe98461ebd73e787cc1b97005b2f807f76f4fe99fb45a6650a04a149a854c8c547e87c77d00afc39426a6756bcd5d7e5d8881221 @@ -297,10 +297,6 @@ def gen_hash(cls, message_bytes): return hashlib.sha256(message_bytes).digest() - def set_warning(self): - if self.timestamp < self.state.get_latest_message_timestamp(): - self.warning = time.strftime("%Y-%m-%d %H:%M:%S: ", time.localtime(self.timestamp)) - def get_message_bytes(self, peer=None): command = self.command speaker = Message._pad(self.speaker, MAX_SPEAKER_SIZE) diff -uNr a/blatta/lib/station.py b/blatta/lib/station.py --- a/blatta/lib/station.py 24c203c6741b7eb17bf86c2a1046d5be50f4fdecc7e9b4e5316e2f9101bedee9b84ce01a666edf98f6545574571358e5b2ebc19b12c941f006bc1182dc2992f2 +++ b/blatta/lib/station.py 4a412c5198c031650023fcbeb12ecb8f2144d9cef45b9996873c444a8fc246e61b96755250dd0d76ef7b9087cbb49121ce7bcbadc2e043ac7b0114fd5514eb4f @@ -1,4 +1,6 @@ -VERSION = 9982 +import time + +VERSION = 9981 import binascii import logging @@ -206,11 +208,17 @@ if self.long_buffer.has(message.message_hash): return - # set a timestamp warning if the message is older than the last displayed message. - message.set_warning() - # send to the irc client if self.client: + # emit a replay warning if this message is a getdata response and older than the last + # displayed message + if message.get_data_response: + if message.timestamp < self.state.get_latest_message_timestamp(): + warning = time.strftime( + "Replay: %Y-%m-%d %H:%M:%S:", + time.localtime(message.timestamp) + ) + self.client.pest_reply(warning) self.client.message_from_station(message) # we only update the address table if the speaker is same as peer