mirror of
https://github.com/mautrix/telegram.git
synced 2026-05-17 07:25:46 +03:00
Fix files in private chats
This commit is contained in:
@@ -10,7 +10,7 @@ A Telegram chat will be created once the bridge is stable enough.
|
||||
### Setup
|
||||
0. Clone the repository
|
||||
1. Set up the virtual environment
|
||||
1. Create with `virtualenv -p /usr/bin/python3 .venv`
|
||||
1. Create with `virtualenv -p /usr/bin/python3.6 .venv`
|
||||
2. Activate with `source .venv/bin/activate`
|
||||
2. Install dependencies with `pip install -r requirements.txt`
|
||||
3. Create a copy of `example-config.yaml` and fill out the fields.
|
||||
|
||||
@@ -244,12 +244,17 @@ class User:
|
||||
portal = po.Portal.get_by_tgid(update.chat_id, peer_type="chat")
|
||||
sender = pu.Puppet.get(update.from_id)
|
||||
elif isinstance(update, UpdateShortMessage):
|
||||
print(update)
|
||||
portal = po.Portal.get_by_tgid(update.user_id, self.tgid, "user")
|
||||
sender = pu.Puppet.get(self.tgid if update.out else update.user_id)
|
||||
elif isinstance(update, (UpdateNewMessage, UpdateNewChannelMessage)):
|
||||
update = update.message
|
||||
if isinstance(update.to_id, PeerUser) and not update.out:
|
||||
portal = po.Portal.get_by_tgid(update.from_id, peer_type="user",
|
||||
tg_receiver=self.tgid)
|
||||
else:
|
||||
portal = po.Portal.get_by_entity(update.to_id, receiver_id=self.tgid)
|
||||
sender = pu.Puppet.get(update.from_id)
|
||||
portal = po.Portal.get_by_entity(update.to_id, receiver_id=self.tgid)
|
||||
return update, sender, portal
|
||||
|
||||
def update_message(self, update):
|
||||
|
||||
Reference in New Issue
Block a user