Commit b2e6d29c authored by Link Mauve's avatar Link Mauve

Merge branch 'master' into 'master'


See merge request poezio/poezio!69
parents a5b202ac cd2adbbc
Remove GET trackers from URLs in sent messages.
from poezio.plugin import BasePlugin
import re
class Plugin(BasePlugin):
def init(self):
self.api.add_event_handler('muc_say', self.remove_get_trackers)
self.api.add_event_handler('conversation_say', self.remove_get_trackers)
self.api.add_event_handler('private_say', self.remove_get_trackers)
def remove_get_trackers(self, msg, tab):
# fbclid: used globally (Facebook)
# utm_*: used globally
# ncid: DoubleClick (Google)
# ref_src, ref_url: twitter
# Others exist but are excluded because they are not common.
# See
msg['body'] = re.sub('(https?://[^ ]+)&?(fbclid|dclid|ncid|utm_source|utm_medium|utm_campaign|utm_term|utm_content|ref_src|ref_url)=[^ &#]*',
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