Skip to content

Commit

Permalink
Minor incoming messages refactor and send m.notice on decryption erro…
Browse files Browse the repository at this point in the history
…rs (#496)

We were falling through without propagating errors anywhere. I caught
most decryption errors and send them along in the new Err field in
DecryptionResult, to be then passed along to the bridge as a new type of
chat event.

I'm going to do another pass to catch any last decryption errors, but
this should be a big improvement over what we currently do.
  • Loading branch information
smweber committed Apr 11, 2024
1 parent d946571 commit e369a56
Show file tree
Hide file tree
Showing 3 changed files with 459 additions and 363 deletions.
18 changes: 12 additions & 6 deletions pkg/signalmeow/events/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ type SignalEvent interface {
isSignalEvent()
}

func (*ChatEvent) isSignalEvent() {}
func (*Receipt) isSignalEvent() {}
func (*ReadSelf) isSignalEvent() {}
func (*Call) isSignalEvent() {}
func (*ContactList) isSignalEvent() {}
func (*ACIFound) isSignalEvent() {}
func (*ChatEvent) isSignalEvent() {}
func (*DecryptionError) isSignalEvent() {}
func (*Receipt) isSignalEvent() {}
func (*ReadSelf) isSignalEvent() {}
func (*Call) isSignalEvent() {}
func (*ContactList) isSignalEvent() {}
func (*ACIFound) isSignalEvent() {}

type MessageInfo struct {
Sender uuid.UUID
Expand All @@ -47,6 +48,11 @@ type ChatEvent struct {
Event signalpb.ChatEventContent
}

type DecryptionError struct {
Sender uuid.UUID
Err error
}

type Receipt struct {
Sender uuid.UUID
Content *signalpb.ReceiptMessage
Expand Down

0 comments on commit e369a56

Please sign in to comment.