fork of https://f-hub.org/XMPP/xmpp-discord-bridge

xmpp: Fix webhook not working if using avatar relaying

+12 -6
+2 -1
xmpp_discord_bridge/avatar.py
··· 74 """ 75 Returns either the URL to the avatar of @jid or None. 76 """ 77 - return self._avatars.get(jid, None)
··· 74 """ 75 Returns either the URL to the avatar of @jid or None. 76 """ 77 + filename = self._avatars.get(jid, None) 78 + return self._public + filename if filename else None
+10 -5
xmpp_discord_bridge/main.py
··· 263 264 self._logger.debug("Webhook: %s", str(webhook)) 265 266 - requests.post(self._webhooks[muc], 267 - data=webhook, 268 - headers={ 269 - "Content-Type": "application/json" 270 - }) 271 272 def virtual_user_update_presence(self, muc, uid, pshow, pstatus=None): 273 """
··· 263 264 self._logger.debug("Webhook: %s", str(webhook)) 265 266 + req = requests.post(self._webhooks[muc], 267 + data=webhook, 268 + headers={ 269 + "Content-Type": "application/json" 270 + }) 271 + if req.status_code != 200: 272 + self._logger.error("Failed to POST to %s with content %s: %s", 273 + self._webhooks[muc], 274 + str(webhook), 275 + req.text) 276 277 def virtual_user_update_presence(self, muc, uid, pshow, pstatus=None): 278 """