jabber_mirror: Do domain replacement more safely
(imported from commit 1a6a3d23120f06d54bc954d4e89d5fccf666332e)
This commit is contained in:
parent
8d787f888f
commit
f18525acd1
|
@ -165,7 +165,9 @@ class ZulipToJabberBot(zulip.Client):
|
||||||
for recipient in msg['display_recipient']:
|
for recipient in msg['display_recipient']:
|
||||||
if recipient["email"] == self.email:
|
if recipient["email"] == self.email:
|
||||||
continue
|
continue
|
||||||
jabber_recipient = recipient['email'].replace(options.zulip_domain, options.jabber_domain)
|
recip_email = recipient['email']
|
||||||
|
username = recip_email[:recip_email.rfind(options.zulip_domain)]
|
||||||
|
jabber_recipient = username + options.jabber_domain
|
||||||
outgoing = self.jabber.make_message(
|
outgoing = self.jabber.make_message(
|
||||||
mto = jabber_recipient,
|
mto = jabber_recipient,
|
||||||
mbody = msg['content'],
|
mbody = msg['content'],
|
||||||
|
|
Loading…
Reference in a new issue