Minor style fixes
This commit is contained in:
@@ -690,7 +690,7 @@ class Portal:
|
|||||||
name = media.caption
|
name = media.caption
|
||||||
await intent.set_typing(self.mxid, is_typing=False)
|
await intent.set_typing(self.mxid, is_typing=False)
|
||||||
return await intent.send_image(self.mxid, uploaded["content_uri"], info=info,
|
return await intent.send_image(self.mxid, uploaded["content_uri"], info=info,
|
||||||
text=name)
|
text=name)
|
||||||
|
|
||||||
def convert_webp(self, file, to="png"):
|
def convert_webp(self, file, to="png"):
|
||||||
try:
|
try:
|
||||||
@@ -733,7 +733,7 @@ class Portal:
|
|||||||
type = "m.image"
|
type = "m.image"
|
||||||
await intent.set_typing(self.mxid, is_typing=False)
|
await intent.set_typing(self.mxid, is_typing=False)
|
||||||
return await intent.send_file(self.mxid, uploaded["content_uri"], info=info,
|
return await intent.send_file(self.mxid, uploaded["content_uri"], info=info,
|
||||||
text=name, file_type=type)
|
text=name, file_type=type)
|
||||||
|
|
||||||
def handle_telegram_location(self, source, intent, location):
|
def handle_telegram_location(self, source, intent, location):
|
||||||
long = location.long
|
long = location.long
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ class Puppet:
|
|||||||
if self.username else 0)
|
if self.username else 0)
|
||||||
displayname_similarity = (SequenceMatcher(None, self.displayname, query).ratio()
|
displayname_similarity = (SequenceMatcher(None, self.displayname, query).ratio()
|
||||||
if self.displayname else 0)
|
if self.displayname else 0)
|
||||||
#phone_number_similarity = (SequenceMatcher(None, self.phone_number, query).ratio()
|
|
||||||
# if self.phone_number else 0)
|
|
||||||
similarity = max(username_similarity, displayname_similarity)
|
similarity = max(username_similarity, displayname_similarity)
|
||||||
return round(similarity * 1000) / 10
|
return round(similarity * 1000) / 10
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class MautrixTelegramClient(TelegramClient):
|
|||||||
|
|
||||||
return self._get_response_message(request, result)
|
return self._get_response_message(request, result)
|
||||||
|
|
||||||
async def send_file(self, entity, file, mime_type=None, caption=None, attributes=None, file_name=None,
|
async def send_file(self, entity, file, mime_type=None, caption=None, attributes=None,
|
||||||
reply_to=None, **kwargs):
|
file_name=None, reply_to=None, **kwargs):
|
||||||
entity = await self.get_input_entity(entity)
|
entity = await self.get_input_entity(entity)
|
||||||
reply_to = self._get_reply_to(reply_to)
|
reply_to = self._get_reply_to(reply_to)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user