def send(msg, server, witem): prefix = irssi.settings_get_str("prefix") targets = irssi.settings_get_str("prefix_targets") cmdchars = irssi.settings_get_str("cmdchars") if re.match("^([%s]|%s)" % (cmdchars, prefix), msg): return if not check_target(witem.name, targets): return signal = irssi.signal_get_emitted() msg = "%s%s" % (prefix, msg) irssi.signal_stop() irssi.signal_emit(signal, msg, server, witem)
def send(msg, server, witem): global stripped_out if stripped_out: return signal = irssi.signal_get_emitted() if msg.startswith("/nounaccent"): msg = msg[len("/nounaccent") + 1 :] elif not msg.startswith("/dict") and not msg.startswith("/spell"): msg = unaccent(msg) stripped_out = True irssi.signal_stop() irssi.signal_emit(signal, msg, server, witem) stripped_out = False