Avoid inviting self when sending a PM from a different pnut client

Fixes #63
This commit is contained in:
Morgan McMillian 2022-12-16 12:07:16 -08:00
parent de7f4f5c35
commit 03ba94ecb9
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Docker image
### Fixed
- Self-invite when sending a PM from a pnut app
## [1.3.0] - 2022-08-20
### Added

View file

@ -70,6 +70,8 @@ def new_message(msg, meta):
invitees=[]
for pm_user in meta['subscribed_user_ids']:
user = Users.query.filter(Users.pnut_user_id == pm_user).one_or_none()
if int(pm_user) == msg.user.id:
continue
if user is not None:
invitees.append(user.matrix_id)
if len(invitees) > 0: