cleanup/bugfixes
This commit is contained in:
@@ -109,6 +109,9 @@ class XMPPTelegram(ComponentXMPP):
|
||||
"""
|
||||
jid = iq['from'].bare
|
||||
|
||||
if iq['type'] == 'normal':
|
||||
raise XMPPError(text="Sorry, this type of message is not supported")
|
||||
|
||||
if iq['to'] == self.config['jid'] and iq['type'] == 'chat': # message to gateway
|
||||
if iq['body'].startswith('!'):
|
||||
self.process_command(iq)
|
||||
@@ -161,6 +164,8 @@ class XMPPTelegram(ComponentXMPP):
|
||||
result = None
|
||||
|
||||
# detect media
|
||||
#TODO: fix
|
||||
#TODO: implement OOB for images
|
||||
if msg.startswith('http') and re.match(r'(?:http\:|https\:)?\/\/.*\.(?:' + self.config['media_external_formats'] + ')', msg):
|
||||
urls = re.findall(r'(?:http\:|https\:)?\/\/.*\.(?:' + self.config['media_external_formats'] + ')', msg)
|
||||
message = msg.replace(urls[0], '')
|
||||
|
||||
Reference in New Issue
Block a user