Add config option to mark joined Telegram notices as read automatically
This commit is contained in:
@@ -159,6 +159,7 @@ class Config(BaseBridgeConfig):
|
|||||||
copy("bridge.tag_only_on_create")
|
copy("bridge.tag_only_on_create")
|
||||||
copy("bridge.bridge_matrix_leave")
|
copy("bridge.bridge_matrix_leave")
|
||||||
copy("bridge.kick_on_logout")
|
copy("bridge.kick_on_logout")
|
||||||
|
copy("bridge.always_read_joined_telegram_notice")
|
||||||
copy("bridge.backfill.invite_own_puppet")
|
copy("bridge.backfill.invite_own_puppet")
|
||||||
copy("bridge.backfill.takeout_limit")
|
copy("bridge.backfill.takeout_limit")
|
||||||
copy("bridge.backfill.initial_limit")
|
copy("bridge.backfill.initial_limit")
|
||||||
|
|||||||
@@ -282,6 +282,8 @@ bridge:
|
|||||||
bridge_matrix_leave: true
|
bridge_matrix_leave: true
|
||||||
# Should the user be kicked out of all portals when logging out of the bridge?
|
# Should the user be kicked out of all portals when logging out of the bridge?
|
||||||
kick_on_logout: true
|
kick_on_logout: true
|
||||||
|
# Should the "* user joined Telegram" notice always be marked as read automatically?
|
||||||
|
always_read_joined_telegram_notice: true
|
||||||
# Settings for backfilling messages from Telegram.
|
# Settings for backfilling messages from Telegram.
|
||||||
backfill:
|
backfill:
|
||||||
# Whether or not the Telegram ghosts of logged in Matrix users should be
|
# Whether or not the Telegram ghosts of logged in Matrix users should be
|
||||||
|
|||||||
@@ -3339,10 +3339,7 @@ class Portal(DBPortal, BasePortal):
|
|||||||
tg_space=source.tgid,
|
tg_space=source.tgid,
|
||||||
edit_index=0,
|
edit_index=0,
|
||||||
).insert()
|
).insert()
|
||||||
# Automatically mark the notice as read if we're backfilling messages, mostly so that
|
if self.config["bridge.always_read_joined_telegram_notice"]:
|
||||||
# empty rooms created before the notice was added wouldn't become unread when the notice
|
|
||||||
# is backfilled in.
|
|
||||||
if backfill:
|
|
||||||
double_puppet = await p.Puppet.get_by_tgid(source.tgid)
|
double_puppet = await p.Puppet.get_by_tgid(source.tgid)
|
||||||
if double_puppet and double_puppet.is_real_user:
|
if double_puppet and double_puppet.is_real_user:
|
||||||
await double_puppet.intent.mark_read(self.mxid, event_id)
|
await double_puppet.intent.mark_read(self.mxid, event_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user