Commit 3c688335 authored by mathieui's avatar mathieui

Fix #2453 (malformed stanzas with stupid plugins)

remove xhtml prior to performing stuff
parent d353584a
......@@ -2,6 +2,7 @@
Once loaded, everything you will send will be IN CAPITAL LETTERS.
"""
from plugin import BasePlugin
import xhtml
class Plugin(BasePlugin):
def init(self):
......@@ -10,4 +11,4 @@ class Plugin(BasePlugin):
self.api.add_event_handler('private_say', self.caps)
def caps(self, msg, tab):
msg['body'] = msg['body'].upper()
msg['body'] = xhtml.clean_text(msg['body']).upper()
......@@ -3,6 +3,7 @@ Reverse everything you say (``Je proteste énergiquement`` will become
``tnemeuqigrené etsetorp eJ``)
"""
from plugin import BasePlugin
import xhtml
class Plugin(BasePlugin):
def init(self):
......@@ -11,4 +12,4 @@ class Plugin(BasePlugin):
self.api.add_event_handler('private_say', self.revstr)
def revstr(self, msg, tab):
msg['body'] = msg['body'][::-1]
msg['body'] = xhtml.clean_text(msg['body'])[::-1]
......@@ -4,12 +4,13 @@ Shuffle the words in every message you send in a :ref:`muctab`
"""
from plugin import BasePlugin
from random import shuffle
import xhtml
class Plugin(BasePlugin):
def init(self):
self.api.add_event_handler('muc_say', self.shuffle)
def shuffle(self, msg, tab):
split = msg['body'].split()
split = xhtml.clean_text(msg['body']).split()
shuffle(split)
msg['body'] = ' '.join(split)
......@@ -3,6 +3,7 @@ Insert a space between each character, in messages that you send, making
them horrible to read.
"""
from plugin import BasePlugin
import xhtml
class Plugin(BasePlugin):
def init(self):
......@@ -11,4 +12,4 @@ class Plugin(BasePlugin):
self.api.add_event_handler('private_say', self.add_spaces)
def add_spaces(self, msg, tab):
msg['body'] = " ".join(x for x in msg['body'])
msg['body'] = " ".join(x for x in xhtml.clean_text(msg['body']))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment