bridgev2/networkinterface: add interface to handle deleting chat from matrix

This commit is contained in:
Ping Chen 2025-09-05 16:29:59 +09:00
commit 77e6174ff8
No known key found for this signature in database
GPG key ID: CF5041D26DAACCE4

View file

@ -984,6 +984,14 @@ type PushParsingNetwork interface {
ParsePushNotification(ctx context.Context, data json.RawMessage) (networkid.UserLoginID, any, error)
}
// DeleteChatHandlingNetworkAPI is an optional interface that network connectors
// can implement to delete a chat from the remote network.
type DeleteChatHandlingNetworkAPI interface {
NetworkAPI
// HandleMatrixDeleteChat is called when the user explicitly deletes a chat.
HandleMatrixDeleteChat(ctx context.Context, msg *MatrixDeleteChat) error
}
type RemoteEventType int
func (ret RemoteEventType) String() string {
@ -1374,6 +1382,13 @@ type MatrixViewingChat struct {
Portal *Portal
}
type MatrixDeleteChat struct {
// The portal that the user deleted.
Portal *Portal
// Delete the chat for the other user in that chat. Not every bridge supports this.
DeleteForEveryone bool
}
type MatrixMarkedUnread = MatrixRoomMeta[*event.MarkedUnreadEventContent]
type MatrixMute = MatrixRoomMeta[*event.BeeperMuteEventContent]
type MatrixRoomTag = MatrixRoomMeta[*event.TagEventContent]