Skip to content

Commit

Permalink
blaaah.. Locations. Fix issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Mar 6, 2018
1 parent a4a6e43 commit 0dfd3c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions wat_bridge/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ def to_tg_handler(sender, **kwargs):
output = "Media from %s\n" % participant_id
if message_url.startswith("LOCATION=|=|="):
locstr, lat, lng = message_url.split("=|=|=")
#tgbot.send_message(chat_id, output)
#tgbot.send_location(chat_id, lat, lng)
tgbot.send_message(chat_id, output)
tgbot.send_location(chat_id, lat, lng)
# vcard can be handled in a similar manner
elif message_url.startswith("VCARDCONTACT=|=|="):
constr, name, cdata = message_url.split("=|=|=")
# TODO: but How?
else:
mime = magic.Magic(mime=True)
mime_type = mime.from_file(message_url)
Expand Down
4 changes: 2 additions & 2 deletions wat_bridge/wa.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def on_message(self, message):

# HelpInstructions = "Please send the above message in the Telegram group that you would like to bridge!"
# self.send_msg(phone=sender, message=HelpInstructions)
self.send_msg(phone=sender, message="new tregistrations are closed. please contact https://youtu.be/9r-yzKfL8xw for bridging Telegram ")
self.send_msg(phone=sender, message="new registrations are closed. please contact https://youtu.be/9r-yzKfL8xw for bridging Telegram ")
return
elif body.startswith('/add'):
if participant == sender:
Expand Down Expand Up @@ -194,7 +194,7 @@ def on_message(self, message):
uniqueFilename = "LOCATION=|=|=" + message.getLatitude() + "=|=|=" + message.getLongitude()
elif message.getMediaType() == "vcard":
logger.info("Echoing vcard (%s, %s) to %s" % (message.getName(), message.getCardData(), message.getFrom(False)))

uniqueFilename = "VCARDCONTACT=|=|=" + message.getName() + "=|=|=" + message.getCardData()
if contact_name :
TheRealMessageToSend = contact_name + "=|=|=" + uniqueFilename
else:
Expand Down

0 comments on commit 0dfd3c3

Please sign in to comment.