1
0
Fork 0
mirror of https://github.com/mautrix/signal.git synced 2026-05-15 21:56:53 -04:00
mautrix-signal/pkg/signalmeow/events/message.go

103 lines
2.6 KiB
Go
Raw Permalink Normal View History

// mautrix-signal - A Matrix-signal puppeting bridge.
// Copyright (C) 2024 Tulir Asokan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package events
import (
"github.com/google/uuid"
2024-03-22 15:37:21 +02:00
"go.mau.fi/mautrix-signal/pkg/libsignalgo"
signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf"
"go.mau.fi/mautrix-signal/pkg/signalmeow/types"
)
type SignalEvent interface {
isSignalEvent()
}
func (*ChatEvent) isSignalEvent() {}
func (*DecryptionError) isSignalEvent() {}
func (*Receipt) isSignalEvent() {}
func (*ReadSelf) isSignalEvent() {}
func (*Call) isSignalEvent() {}
func (*ContactList) isSignalEvent() {}
func (*ACIFound) isSignalEvent() {}
func (*DeleteForMe) isSignalEvent() {}
func (*MessageRequestResponse) isSignalEvent() {}
func (*QueueEmpty) isSignalEvent() {}
func (*LoggedOut) isSignalEvent() {}
type MessageInfo struct {
Sender uuid.UUID
ChatID string
GroupRevision uint32
ServerTimestamp uint64
}
type ChatEvent struct {
Info MessageInfo
Event signalpb.ChatEventContent
}
type DecryptionError struct {
2024-09-09 19:25:08 +03:00
Sender uuid.UUID
Err error
Timestamp uint64
}
type Receipt struct {
Sender uuid.UUID
Content *signalpb.ReceiptMessage
}
type ReadSelf struct {
Timestamp uint64
Messages []*signalpb.SyncMessage_Read
}
type Call struct {
Info MessageInfo
Timestamp uint64
IsRinging bool
}
2024-01-05 20:37:47 +02:00
type ContactList struct {
2024-03-22 21:24:30 +02:00
Contacts []*types.Recipient
IsFromDB bool
}
2024-03-22 15:37:21 +02:00
type ACIFound struct {
PNI libsignalgo.ServiceID
ACI libsignalgo.ServiceID
}
type DeleteForMe struct {
Timestamp uint64
*signalpb.SyncMessage_DeleteForMe
}
type MessageRequestResponse struct {
Timestamp uint64
ThreadACI uuid.UUID
GroupID *libsignalgo.GroupIdentifier
Type signalpb.SyncMessage_MessageRequestResponse_Type
Raw *signalpb.SyncMessage_MessageRequestResponse
}
type QueueEmpty struct{}
type LoggedOut struct{ Error error }