+ self.msg(user, msg)
+
+ """
+ Does the work for msg/slowmsg/fastmsg. Uses the append_callback to append to the correct queue.
+
+ In the case of fastmsg, self.conn.exceeded may be True, however, in this case append_callback=self.conn.send, so it will still be sent immediately.
+ """
+ def _msg(self, target, msg, truncate, append_callback, msgtype):
+ if self.parent.cfg.getboolean('erebus', 'nofakelag'): return self.fastmsg(target, msg)
+
+ cmd = self._formatmsg(target, msg, msgtype)
+ # The max length is much shorter than recvq (510) because of the length the server adds on about the source (us).
+ # If you know your hostmask, you can of course figure the exact length, but it's very difficult to reliably know your hostmask.
+ maxlen = (
+ self.conn.recvq
+ - 63 # max hostname len
+ - 11 # max ident len
+ - 3 # the symbols in :nick!user@host
+ - len(self.nick)
+ )
+ if len(cmd) > maxlen:
+ if not truncate:
+ return False
+ else:
+ cmd = cmd[:maxlen]