Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateAlias(id string) (string, error)
- func Identicon(id string) (string, error)
- func NewCommunityRequestToJoinNotification(id string, community *communities.Community, contact *Contact) *localnotifications.Notification
- func NewMessageNotification(id string, message *common.Message, chat *Chat, contact *Contact, ...) (*localnotifications.Notification, error)
- func NewSQLitePersistence(db *sql.DB) *sqlitePersistence
- func ValidateMembershipUpdateMessage(message *protocol.MembershipUpdateMessage, timeNowMs uint64) error
- func ValidateReceivedAcceptRequestAddressForTransaction(message *protobuf.AcceptRequestAddressForTransaction, whisperTimestamp uint64) error
- func ValidateReceivedChatMessage(message *protobuf.ChatMessage, whisperTimestamp uint64) error
- func ValidateReceivedDeclineRequestAddressForTransaction(message *protobuf.DeclineRequestAddressForTransaction, whisperTimestamp uint64) error
- func ValidateReceivedDeclineRequestTransaction(message *protobuf.DeclineRequestTransaction, whisperTimestamp uint64) error
- func ValidateReceivedEmojiReaction(emoji *protobuf.EmojiReaction, whisperTimestamp uint64) error
- func ValidateReceivedGroupChatInvitation(invitation *protobuf.GroupChatInvitation) error
- func ValidateReceivedPairInstallation(message *protobuf.PairInstallation, whisperTimestamp uint64) error
- func ValidateReceivedRequestAddressForTransaction(message *protobuf.RequestAddressForTransaction, whisperTimestamp uint64) error
- func ValidateReceivedRequestTransaction(message *protobuf.RequestTransaction, whisperTimestamp uint64) error
- func ValidateReceivedSendTransaction(message *protobuf.SendTransaction, whisperTimestamp uint64) error
- func WithDatasync() func(c *config) error
- func WithPushNotifications() func(c *config) error
- type ActivityCenterNotification
- type ActivityCenterPaginationResponse
- type ActivityCenterType
- type Chat
- func CreateCommunityChat(orgID, chatID string, orgChat *protobuf.CommunityChat, ...) *Chat
- func CreateCommunityChats(org *communities.Community, timesource common.TimeSource) []*Chat
- func CreateGroupChat(timesource common.TimeSource) Chat
- func CreateOneToOneChat(name string, publicKey *ecdsa.PublicKey, timesource common.TimeSource) *Chat
- func CreateProfileChat(pubkey string, timesource common.TimeSource) *Chat
- func CreatePublicChat(name string, timesource common.TimeSource) *Chat
- func CreateTimelineChat(timesource common.TimeSource) *Chat
- func OneToOneFromPublicKey(pk *ecdsa.PublicKey, timesource common.TimeSource) *Chat
- func (c *Chat) CommunityChat() bool
- func (c *Chat) CommunityChatID() string
- func (c *Chat) DeepLink() string
- func (c *Chat) HasJoinedMember(memberID string) bool
- func (c *Chat) HasMember(memberID string) bool
- func (c *Chat) JoinedMembersAsPublicKeys() ([]*ecdsa.PublicKey, error)
- func (c *Chat) MembersAsPublicKeys() ([]*ecdsa.PublicKey, error)
- func (c *Chat) NextClockAndTimestamp(timesource common.TimeSource) (uint64, uint64)
- func (c *Chat) OneToOne() bool
- func (c *Chat) PrivateGroupChat() bool
- func (c *Chat) ProfileUpdates() bool
- func (c *Chat) Public() bool
- func (c *Chat) PublicKey() (*ecdsa.PublicKey, error)
- func (c *Chat) Timeline() bool
- func (c *Chat) UpdateFromMessage(message *common.Message, timesource common.TimeSource) error
- func (c *Chat) Validate() error
- type ChatMember
- type ChatMembershipUpdate
- type ChatType
- type Contact
- func (c *Contact) CanonicalImage() string
- func (c *Contact) CanonicalName() string
- func (c Contact) HasBeenAdded() bool
- func (c Contact) HasCustomFields() bool
- func (c Contact) IsAdded() bool
- func (c Contact) IsBlocked() bool
- func (c Contact) PublicKey() (*ecdsa.PublicKey, error)
- func (c *Contact) Remove()
- type ContactDeviceInfo
- type CurrentMessageState
- type EmojiReaction
- func (e EmojiReaction) GetProtobuf() proto.Message
- func (e EmojiReaction) GetSigPubKey() *ecdsa.PublicKey
- func (e EmojiReaction) ID() string
- func (e EmojiReaction) MarshalJSON() ([]byte, error)
- func (e *EmojiReaction) SetMessageType(messageType protobuf.MessageType)
- func (e EmojiReaction) WrapGroupMessage() bool
- type EnvelopeEventsInterceptor
- func (interceptor EnvelopeEventsInterceptor) EnvelopeExpired(identifiers [][]byte, err error)
- func (interceptor EnvelopeEventsInterceptor) EnvelopeSent(identifiers [][]byte)
- func (interceptor EnvelopeEventsInterceptor) MailServerRequestCompleted(requestID types.Hash, lastEnvelopeHash types.Hash, cursor []byte, err error)
- func (interceptor EnvelopeEventsInterceptor) MailServerRequestExpired(hash types.Hash)
- type EthClient
- type GroupChatInvitation
- type MailserverBatch
- type MessageDeliveredHandler
- type MessageHandler
- func (m *MessageHandler) HandleAcceptRequestAddressForTransaction(messageState *ReceivedMessageState, ...) error
- func (m *MessageHandler) HandleChatIdentity(state *ReceivedMessageState, ci protobuf.ChatIdentity) error
- func (m *MessageHandler) HandleChatMessage(state *ReceivedMessageState) error
- func (m *MessageHandler) HandleCommunityDescription(state *ReceivedMessageState, signer *ecdsa.PublicKey, ...) error
- func (m *MessageHandler) HandleCommunityInvitation(state *ReceivedMessageState, signer *ecdsa.PublicKey, ...) error
- func (m *MessageHandler) HandleCommunityRequestToJoin(state *ReceivedMessageState, signer *ecdsa.PublicKey, ...) error
- func (m *MessageHandler) HandleContactUpdate(state *ReceivedMessageState, message protobuf.ContactUpdate) error
- func (m *MessageHandler) HandleDeclineRequestAddressForTransaction(messageState *ReceivedMessageState, ...) error
- func (m *MessageHandler) HandleDeclineRequestTransaction(messageState *ReceivedMessageState, command protobuf.DeclineRequestTransaction) error
- func (m *MessageHandler) HandleEmojiReaction(state *ReceivedMessageState, pbEmojiR protobuf.EmojiReaction) error
- func (m *MessageHandler) HandleGroupChatInvitation(state *ReceivedMessageState, pbGHInvitations protobuf.GroupChatInvitation) error
- func (m *MessageHandler) HandleMembershipUpdate(messageState *ReceivedMessageState, chat *Chat, ...) error
- func (m *MessageHandler) HandlePairInstallation(state *ReceivedMessageState, message protobuf.PairInstallation) error
- func (m *MessageHandler) HandlePinMessage(state *ReceivedMessageState, message protobuf.PinMessage) error
- func (m *MessageHandler) HandleRequestAddressForTransaction(messageState *ReceivedMessageState, ...) error
- func (m *MessageHandler) HandleRequestTransaction(messageState *ReceivedMessageState, command protobuf.RequestTransaction) error
- func (m *MessageHandler) HandleSendTransaction(messageState *ReceivedMessageState, command protobuf.SendTransaction) error
- func (m *MessageHandler) HandleSyncInstallationContact(state *ReceivedMessageState, message protobuf.SyncInstallationContact) error
- func (m *MessageHandler) HandleSyncInstallationPublicChat(state *ReceivedMessageState, message protobuf.SyncInstallationPublicChat) *Chat
- type Messenger
- func (m *Messenger) AcceptActivityCenterNotifications(ids []types.HexBytes) (*MessengerResponse, error)
- func (m *Messenger) AcceptAllActivityCenterNotifications() (*MessengerResponse, error)
- func (m *Messenger) AcceptRequestAddressForTransaction(ctx context.Context, messageID, address string) (*MessengerResponse, error)
- func (m *Messenger) AcceptRequestToJoinCommunity(request *requests.AcceptRequestToJoinCommunity) (*MessengerResponse, error)
- func (m *Messenger) AcceptRequestTransaction(ctx context.Context, transactionHash, messageID string, signature []byte) (*MessengerResponse, error)
- func (m *Messenger) ActiveChats() []*Chat
- func (m *Messenger) ActivityCenterNotifications(cursor string, limit uint64) (*ActivityCenterPaginationResponse, error)
- func (m *Messenger) AddAdminsToGroupChat(ctx context.Context, chatID string, members []string) (*MessengerResponse, error)
- func (m *Messenger) AddContact(ctx context.Context, pubKey string) (*MessengerResponse, error)
- func (m *Messenger) AddMailserver(enode string) error
- func (m *Messenger) AddMembersToGroupChat(ctx context.Context, chatID string, members []string) (*MessengerResponse, error)
- func (m *Messenger) AddPushNotificationsServer(ctx context.Context, publicKey *ecdsa.PublicKey, ...) error
- func (m *Messenger) BanUserFromCommunity(request *requests.BanUserFromCommunity) (*MessengerResponse, error)
- func (m *Messenger) BlockContact(contact *Contact) ([]*Chat, error)
- func (m *Messenger) ChangeGroupChatName(ctx context.Context, chatID string, name string) (*MessengerResponse, error)
- func (m *Messenger) Chats() []*Chat
- func (m *Messenger) ClearHistory(request *requests.ClearHistory) (*MessengerResponse, error)
- func (m *Messenger) Communities() ([]*communities.Community, error)
- func (m *Messenger) ConfirmJoiningGroup(ctx context.Context, chatID string) (*MessengerResponse, error)
- func (m *Messenger) ConnectionChanged(state connection.State)
- func (m *Messenger) Contacts() []*Contact
- func (m *Messenger) CreateCommunity(request *requests.CreateCommunity) (*MessengerResponse, error)
- func (m *Messenger) CreateCommunityChat(communityID types.HexBytes, c *protobuf.CommunityChat) (*MessengerResponse, error)
- func (m *Messenger) CreateGroupChatFromInvitation(name string, chatID string, adminPK string) (*MessengerResponse, error)
- func (m *Messenger) CreateGroupChatWithMembers(ctx context.Context, name string, members []string) (*MessengerResponse, error)
- func (m *Messenger) CreateOneToOneChat(request *requests.CreateOneToOneChat) (*MessengerResponse, error)
- func (m *Messenger) CreateProfileChat(request *requests.CreateProfileChat) (*MessengerResponse, error)
- func (m *Messenger) CreatePublicChat(request *requests.CreatePublicChat) (*MessengerResponse, error)
- func (m *Messenger) DeactivateChat(request *requests.DeactivateChat) (*MessengerResponse, error)
- func (m *Messenger) DeclineRequestAddressForTransaction(ctx context.Context, messageID string) (*MessengerResponse, error)
- func (m *Messenger) DeclineRequestToJoinCommunity(request *requests.DeclineRequestToJoinCommunity) error
- func (m *Messenger) DeclineRequestTransaction(ctx context.Context, messageID string) (*MessengerResponse, error)
- func (m *Messenger) DeleteChat(chatID string) error
- func (m *Messenger) DeleteMessage(id string) error
- func (m *Messenger) DeleteMessagesByChatID(id string) error
- func (m *Messenger) DisableInstallation(id string) error
- func (m *Messenger) DisablePushNotificationsBlockMentions() error
- func (m *Messenger) DisablePushNotificationsFromContactsOnly() error
- func (m *Messenger) DisableSendingPushNotifications() error
- func (m *Messenger) DismissActivityCenterNotifications(ids []types.HexBytes) error
- func (m *Messenger) DismissAllActivityCenterNotifications() error
- func (m *Messenger) ENSVerified(pubkey, ensName string) error
- func (m *Messenger) EditCommunity(request *requests.EditCommunity) (*MessengerResponse, error)
- func (m *Messenger) EmojiReactionsByChatID(chatID string, cursor string, limit int) ([]*EmojiReaction, error)
- func (m *Messenger) EnableInstallation(id string) error
- func (m *Messenger) EnablePushNotificationsBlockMentions() error
- func (m *Messenger) EnablePushNotificationsFromContactsOnly() error
- func (m *Messenger) EnableSendingPushNotifications() error
- func (m *Messenger) ExportCommunity(id types.HexBytes) (*ecdsa.PrivateKey, error)
- func (m *Messenger) FillGaps(chatID string, messageIDs []string) error
- func (m *Messenger) GetContactByID(pubKey string) *Contact
- func (m *Messenger) GetGroupChatInvitations() ([]*GroupChatInvitation, error)
- func (m *Messenger) GetPushNotificationsServers() ([]*pushnotificationclient.PushNotificationServer, error)
- func (m *Messenger) ImportCommunity(key *ecdsa.PrivateKey) (*MessengerResponse, error)
- func (m *Messenger) Init() error
- func (m *Messenger) Installations() []*multidevice.Installation
- func (m *Messenger) InviteUsersToCommunity(request *requests.InviteUsersToCommunity) (*MessengerResponse, error)
- func (m *Messenger) Join(chat *Chat) ([]*transport.Filter, error)
- func (m *Messenger) JoinCommunity(communityID types.HexBytes) (*MessengerResponse, error)
- func (m *Messenger) JoinedCommunities() ([]*communities.Community, error)
- func (m *Messenger) LeaveCommunity(communityID types.HexBytes) (*MessengerResponse, error)
- func (m *Messenger) LeaveGroupChat(ctx context.Context, chatID string, remove bool) (*MessengerResponse, error)
- func (m *Messenger) LoadFilters(filters []*transport.Filter) ([]*transport.Filter, error)
- func (m *Messenger) Mailservers() ([]string, error)
- func (m *Messenger) MarkAllActivityCenterNotificationsRead() error
- func (m *Messenger) MarkAllRead(chatID string) error
- func (m *Messenger) MarkMessagesSeen(chatID string, ids []string) (uint64, error)
- func (m *Messenger) MessageByChatID(chatID, cursor string, limit int) ([]*common.Message, string, error)
- func (m *Messenger) MessageByID(id string) (*common.Message, error)
- func (m *Messenger) MessagesExist(ids []string) (map[string]bool, error)
- func (m *Messenger) MuteChat(chatID string) error
- func (m *Messenger) MyPendingRequestsToJoin() ([]*communities.RequestToJoin, error)
- func (m *Messenger) PendingRequestsToJoinForCommunity(id types.HexBytes) ([]*communities.RequestToJoin, error)
- func (m *Messenger) PinnedMessageByChatID(chatID, cursor string, limit int) ([]*common.PinnedMessage, string, error)
- func (m *Messenger) ReSendChatMessage(ctx context.Context, messageID string) error
- func (m *Messenger) RegisterForPushNotifications(ctx context.Context, deviceToken, apnTopic string, ...) error
- func (m *Messenger) RegisteredForPushNotifications() (bool, error)
- func (m *Messenger) RemoveContact(ctx context.Context, pubKey string) (*MessengerResponse, error)
- func (m *Messenger) RemoveFilters(filters []*transport.Filter) error
- func (m *Messenger) RemoveMailserver(id string) error
- func (m *Messenger) RemoveMemberFromGroupChat(ctx context.Context, chatID string, member string) (*MessengerResponse, error)
- func (m *Messenger) RemovePushNotificationServer(ctx context.Context, publicKey *ecdsa.PublicKey) error
- func (m *Messenger) RemoveUserFromCommunity(id types.HexBytes, pkString string) (*MessengerResponse, error)
- func (m *Messenger) RequestAddressForTransaction(ctx context.Context, chatID, from, value, contract string) (*MessengerResponse, error)
- func (m *Messenger) RequestAllHistoricMessages() (*MessengerResponse, error)
- func (m *Messenger) RequestCommunityInfoFromMailserver(communityID string) error
- func (m *Messenger) RequestHistoricMessages(ctx context.Context, from, to uint32, cursor []byte, waitForResponse bool) ([]byte, error)
- func (m *Messenger) RequestHistoricMessagesForFilter(ctx context.Context, from, to uint32, cursor []byte, filter *transport.Filter, ...) ([]byte, error)
- func (m *Messenger) RequestToJoinCommunity(request *requests.RequestToJoinCommunity) (*MessengerResponse, error)
- func (m *Messenger) RequestTransaction(ctx context.Context, chatID, value, contract, address string) (*MessengerResponse, error)
- func (m *Messenger) RetrieveAll() (*MessengerResponse, error)
- func (m *Messenger) SaveChat(chat *Chat) error
- func (m *Messenger) SaveContact(contact *Contact) error
- func (m *Messenger) SaveMessages(messages []*common.Message) error
- func (m *Messenger) SavePinMessages(messages []*common.PinMessage) error
- func (m *Messenger) SelectMailserver(id string) error
- func (m *Messenger) SendChatMessage(ctx context.Context, message *common.Message) (*MessengerResponse, error)
- func (m *Messenger) SendChatMessages(ctx context.Context, messages []*common.Message) (*MessengerResponse, error)
- func (m *Messenger) SendContactUpdate(ctx context.Context, chatID, ensName, profileImage string) (*MessengerResponse, error)
- func (m *Messenger) SendContactUpdates(ctx context.Context, ensName, profileImage string) (err error)
- func (m *Messenger) SendEmojiReaction(ctx context.Context, chatID, messageID string, ...) (*MessengerResponse, error)
- func (m *Messenger) SendEmojiReactionRetraction(ctx context.Context, emojiReactionID string) (*MessengerResponse, error)
- func (m *Messenger) SendGroupChatInvitationRejection(ctx context.Context, invitationRequestID string) (*MessengerResponse, error)
- func (m *Messenger) SendGroupChatInvitationRequest(ctx context.Context, chatID string, adminPK string, message string) (*MessengerResponse, error)
- func (m *Messenger) SendPairInstallation(ctx context.Context) (*MessengerResponse, error)
- func (m *Messenger) SendPinMessage(ctx context.Context, message *common.PinMessage) (*MessengerResponse, error)
- func (m *Messenger) SendTransaction(ctx context.Context, chatID, value, contract, transactionHash string, ...) (*MessengerResponse, error)
- func (m *Messenger) SetInstallationMetadata(id string, data *multidevice.InstallationMetadata) error
- func (m *Messenger) SetMailserver(peer []byte)
- func (m *Messenger) ShareCommunity(request *requests.ShareCommunity) (*MessengerResponse, error)
- func (m *Messenger) Shutdown() (err error)
- func (m *Messenger) SignMessage(message string) ([]byte, error)
- func (m *Messenger) Start() (*MessengerResponse, error)
- func (m *Messenger) StartPushNotificationsServer() error
- func (m *Messenger) StopPushNotificationsServer() error
- func (m *Messenger) SyncChatFromSyncedFrom(chatID string) (uint32, error)
- func (m *Messenger) SyncDevices(ctx context.Context, ensName, photoPath string) (err error)
- func (m *Messenger) UnmuteChat(chatID string) error
- func (m *Messenger) UnreadActivityCenterNotificationsCount() (uint64, error)
- func (m *Messenger) UnregisterFromPushNotifications(ctx context.Context) error
- func (m *Messenger) UpdateMessageOutgoingStatus(id, newOutgoingStatus string) error
- func (m *Messenger) ValidateTransactions(ctx context.Context, addresses []types.Address) (*MessengerResponse, error)
- type MessengerResponse
- func (r *MessengerResponse) ActivityCenterNotifications() []*ActivityCenterNotification
- func (r *MessengerResponse) AddActivityCenterNotification(n *ActivityCenterNotification)
- func (r *MessengerResponse) AddActivityCenterNotifications(ns []*ActivityCenterNotification)
- func (r *MessengerResponse) AddChat(c *Chat)
- func (r *MessengerResponse) AddChats(chats []*Chat)
- func (r *MessengerResponse) AddCommunities(communities []*communities.Community)
- func (r *MessengerResponse) AddCommunity(c *communities.Community)
- func (r *MessengerResponse) AddMessage(message *common.Message)
- func (r *MessengerResponse) AddNotification(n *localnotifications.Notification)
- func (r *MessengerResponse) AddNotifications(notifications []*localnotifications.Notification)
- func (r *MessengerResponse) AddPinMessage(pm *common.PinMessage)
- func (r *MessengerResponse) AddPinMessages(pms []*common.PinMessage)
- func (r *MessengerResponse) AddRemovedChat(chatID string)
- func (r *MessengerResponse) AddRemovedChats(chats []string)
- func (r *MessengerResponse) Chats() []*Chat
- func (r *MessengerResponse) ClearNotifications()
- func (r *MessengerResponse) Communities() []*communities.Community
- func (r *MessengerResponse) IsEmpty() bool
- func (r *MessengerResponse) MarshalJSON() ([]byte, error)
- func (r *MessengerResponse) Merge(response *MessengerResponse) error
- func (r *MessengerResponse) Notifications() []*localnotifications.Notification
- func (r *MessengerResponse) PinMessages() []*common.PinMessage
- func (r *MessengerResponse) RemovedChats() []string
- type MessengerSignalsHandler
- type NotificationBody
- type Option
- func WithAccount(acc *multiaccounts.Account) Option
- func WithCustomLogger(logger *zap.Logger) Option
- func WithDatabase(db *sql.DB) Option
- func WithDatabaseConfig(dbPath, dbKey string) Option
- func WithENSVerificationConfig(onENSVerified func(*MessengerResponse), url, address string) Option
- func WithEnvelopesMonitorConfig(emc *transport.EnvelopesMonitorConfig) Option
- func WithMailserversDatabase(ma *mailservers.Database) Option
- func WithMultiAccounts(ma *multiaccounts.Database) Option
- func WithPushNotificationClientConfig(pushNotificationClientConfig *pushnotificationclient.Config) Option
- func WithPushNotificationServerConfig(pushNotificationServerConfig *pushnotificationserver.Config) Option
- func WithSignalsHandler(h MessengerSignalsHandler) Option
- func WithSystemMessagesTranslations(t map[protobuf.MembershipUpdateEvent_EventType]string) Option
- func WithVerifyTransactionClient(client EthClient) Option
- type ReceivedMessageState
- type TransactionToValidate
- type TransactionValidator
- type VerifyTransactionResponse
Constants ¶
const ( ActivityCenterNotificationTypeNewOneToOne = iota + 1 ActivityCenterNotificationTypeNewPrivateGroupChat )
const (
PubKeyStringLength = 132
)
Variables ¶
var ( ErrChatIDEmpty = errors.New("chat ID is empty") ErrChatNotFound = errors.New("can't find chat") ErrNotImplemented = errors.New("not implemented") ErrContactNotFound = errors.New("contact not found") )
var ErrInvalidActivityCenterNotification = errors.New("invalid activity center notification")
var ErrMessageNotAllowed = errors.New("message from a non-contact")
var ( // ErrMsgAlreadyExist returned if msg already exist. ErrMsgAlreadyExist = errors.New("message with given ID already exist") )
Functions ¶
func GenerateAlias ¶
GenerateAlias name returns the generated name given a public key hex encoded prefixed with 0x
func NewCommunityRequestToJoinNotification ¶ added in v0.74.2
func NewCommunityRequestToJoinNotification(id string, community *communities.Community, contact *Contact) *localnotifications.Notification
func NewMessageNotification ¶ added in v0.74.2
func NewMessageNotification(id string, message *common.Message, chat *Chat, contact *Contact, contacts *contactMap) (*localnotifications.Notification, error)
func NewSQLitePersistence ¶ added in v0.73.5
func ValidateReceivedAcceptRequestAddressForTransaction ¶
func ValidateReceivedAcceptRequestAddressForTransaction(message *protobuf.AcceptRequestAddressForTransaction, whisperTimestamp uint64) error
func ValidateReceivedChatMessage ¶
func ValidateReceivedChatMessage(message *protobuf.ChatMessage, whisperTimestamp uint64) error
func ValidateReceivedDeclineRequestAddressForTransaction ¶
func ValidateReceivedDeclineRequestAddressForTransaction(message *protobuf.DeclineRequestAddressForTransaction, whisperTimestamp uint64) error
func ValidateReceivedDeclineRequestTransaction ¶
func ValidateReceivedDeclineRequestTransaction(message *protobuf.DeclineRequestTransaction, whisperTimestamp uint64) error
func ValidateReceivedEmojiReaction ¶ added in v0.56.4
func ValidateReceivedEmojiReaction(emoji *protobuf.EmojiReaction, whisperTimestamp uint64) error
func ValidateReceivedGroupChatInvitation ¶ added in v0.60.0
func ValidateReceivedGroupChatInvitation(invitation *protobuf.GroupChatInvitation) error
func ValidateReceivedPairInstallation ¶
func ValidateReceivedPairInstallation(message *protobuf.PairInstallation, whisperTimestamp uint64) error
func ValidateReceivedRequestAddressForTransaction ¶
func ValidateReceivedRequestAddressForTransaction(message *protobuf.RequestAddressForTransaction, whisperTimestamp uint64) error
func ValidateReceivedRequestTransaction ¶
func ValidateReceivedRequestTransaction(message *protobuf.RequestTransaction, whisperTimestamp uint64) error
func ValidateReceivedSendTransaction ¶
func ValidateReceivedSendTransaction(message *protobuf.SendTransaction, whisperTimestamp uint64) error
func WithDatasync ¶
func WithDatasync() func(c *config) error
func WithPushNotifications ¶ added in v0.56.1
func WithPushNotifications() func(c *config) error
Types ¶
type ActivityCenterNotification ¶ added in v0.76.0
type ActivityCenterNotification struct { ID types.HexBytes `json:"id"` ChatID string `json:"chatId"` Name string `json:"name"` Type ActivityCenterType `json:"type"` LastMessage *common.Message `json:"lastMessage"` Timestamp uint64 `json:"timestamp"` Read bool `json:"read"` Dismissed bool `json:"dismissed"` Accepted bool `json:"accepted"` }
func (*ActivityCenterNotification) Valid ¶ added in v0.76.0
func (n *ActivityCenterNotification) Valid() error
type ActivityCenterPaginationResponse ¶ added in v0.76.0
type ActivityCenterPaginationResponse struct { Cursor string `json:"cursor"` Notifications []*ActivityCenterNotification `json:"notifications"` }
type ActivityCenterType ¶ added in v0.76.0
type ActivityCenterType int
type Chat ¶
type Chat struct { // ID is the id of the chat, for public chats it is the name e.g. status, for one-to-one // is the hex encoded public key and for group chats is a random uuid appended with // the hex encoded pk of the creator of the chat ID string `json:"id"` Name string `json:"name"` Color string `json:"color"` // Active indicates whether the chat has been soft deleted Active bool `json:"active"` ChatType ChatType `json:"chatType"` // Timestamp indicates the last time this chat has received/sent a message Timestamp int64 `json:"timestamp"` // LastClockValue indicates the last clock value to be used when sending messages LastClockValue uint64 `json:"lastClockValue"` // DeletedAtClockValue indicates the clock value at time of deletion, messages // with lower clock value of this should be discarded DeletedAtClockValue uint64 `json:"deletedAtClockValue"` // Denormalized fields UnviewedMessagesCount uint `json:"unviewedMessagesCount"` LastMessage *common.Message `json:"lastMessage"` // Group chat fields // Members are the members who have been invited to the group chat Members []ChatMember `json:"members"` // MembershipUpdates is all the membership events in the chat MembershipUpdates []v1protocol.MembershipUpdateEvent `json:"membershipUpdateEvents"` // Generated username name of the chat for one-to-ones Alias string `json:"alias,omitempty"` // Identicon generated from public key Identicon string `json:"identicon"` // Muted is used to check whether we want to receive // push notifications for this chat Muted bool `json:"muted,omitempty"` // Public key of administrator who created invitation link InvitationAdmin string `json:"invitationAdmin,omitempty"` // Public key of user profile Profile string `json:"profile,omitempty"` // CommunityID is the id of the community it belongs to CommunityID string `json:"communityId,omitempty"` // Joined is a timestamp that indicates when the chat was joined Joined int64 `json:"joined,omitempty"` // SyncedTo is the time up until it has synced with a mailserver SyncedTo uint32 `json:"syncedTo,omitempty"` // SyncedFrom is the time from when it was synced with a mailserver SyncedFrom uint32 `json:"syncedFrom,omitempty"` }
func CreateCommunityChat ¶ added in v0.67.0
func CreateCommunityChat(orgID, chatID string, orgChat *protobuf.CommunityChat, timesource common.TimeSource) *Chat
func CreateCommunityChats ¶ added in v0.67.0
func CreateCommunityChats(org *communities.Community, timesource common.TimeSource) []*Chat
func CreateGroupChat ¶
func CreateGroupChat(timesource common.TimeSource) Chat
func CreateOneToOneChat ¶
func CreateProfileChat ¶ added in v0.62.14
func CreateProfileChat(pubkey string, timesource common.TimeSource) *Chat
func CreatePublicChat ¶
func CreatePublicChat(name string, timesource common.TimeSource) *Chat
func CreateTimelineChat ¶ added in v0.79.0
func CreateTimelineChat(timesource common.TimeSource) *Chat
func OneToOneFromPublicKey ¶
func OneToOneFromPublicKey(pk *ecdsa.PublicKey, timesource common.TimeSource) *Chat
func (*Chat) CommunityChat ¶ added in v0.74.2
func (*Chat) CommunityChatID ¶ added in v0.67.0
func (*Chat) HasJoinedMember ¶ added in v0.76.0
func (*Chat) JoinedMembersAsPublicKeys ¶ added in v0.61.0
func (*Chat) NextClockAndTimestamp ¶
func (c *Chat) NextClockAndTimestamp(timesource common.TimeSource) (uint64, uint64)
NextClockAndTimestamp returns the next clock value and the current timestamp
func (*Chat) PrivateGroupChat ¶ added in v0.74.2
func (*Chat) ProfileUpdates ¶ added in v0.62.14
func (*Chat) UpdateFromMessage ¶
type ChatMember ¶
type ChatMember struct { // ID is the hex encoded public key of the member ID string `json:"id"` // Admin indicates if the member is an admin of the group chat Admin bool `json:"admin"` // Joined indicates if the member has joined the group chat Joined bool `json:"joined"` }
ChatMember represents a member who participates in a group chat
type ChatMembershipUpdate ¶
type ChatMembershipUpdate struct { // Unique identifier for the event ID string `json:"id"` // Type indicates the kind of event Type protobuf.MembershipUpdateEvent_EventType `json:"type"` // Name represents the name in the event of changing name events Name string `json:"name,omitempty"` // Clock value of the event ClockValue uint64 `json:"clockValue"` // Signature of the event Signature string `json:"signature"` // Hex encoded public key of the creator of the event From string `json:"from"` // Target of the event for single-target events Member string `json:"member,omitempty"` // Target of the event for multi-target events Members []string `json:"members,omitempty"` }
ChatMembershipUpdate represent an event on membership of the chat
type Contact ¶
type Contact struct { // ID of the contact. It's a hex-encoded public key (prefixed with 0x). ID string `json:"id"` // Ethereum address of the contact Address string `json:"address,omitempty"` // ENS name of contact Name string `json:"name,omitempty"` // EnsVerified whether we verified the name of the contact ENSVerified bool `json:"ensVerified"` // Generated username name of the contact Alias string `json:"alias,omitempty"` // Identicon generated from public key Identicon string `json:"identicon"` // LastUpdated is the last time we received an update from the contact // updates should be discarded if last updated is less than the one stored LastUpdated uint64 `json:"lastUpdated"` // SystemTags contains information about whether we blocked/added/have been // added. SystemTags []string `json:"systemTags"` DeviceInfo []ContactDeviceInfo `json:"deviceInfo"` LocalNickname string `json:"localNickname,omitempty"` Images map[string]images.IdentityImage `json:"images"` }
Contact has information about a "Contact". A contact is not necessarily one that we added or added us, that's based on SystemTags.
func BuildContactFromPublicKey ¶ added in v0.79.0
func (*Contact) CanonicalImage ¶ added in v0.74.2
func (*Contact) CanonicalName ¶ added in v0.74.2
func (Contact) HasBeenAdded ¶
func (Contact) HasCustomFields ¶ added in v0.52.3
HasCustomFields returns whether the the contact has any field that is valuable to the client other than the computed name/image
type ContactDeviceInfo ¶
type ContactDeviceInfo struct { // The installation id of the device InstallationID string `json:"id"` // Timestamp represents the last time we received this info Timestamp int64 `json:"timestamp"` // FCMToken is to be used for push notifications FCMToken string `json:"fcmToken"` }
ContactDeviceInfo is a struct containing information about a particular device owned by a contact
type CurrentMessageState ¶
type CurrentMessageState struct { // Message is the protobuf message received Message protobuf.ChatMessage // MessageID is the ID of the message MessageID string // WhisperTimestamp is the whisper timestamp of the message WhisperTimestamp uint64 // Contact is the contact associated with the author of the message Contact *Contact // PublicKey is the public key of the author of the message PublicKey *ecdsa.PublicKey }
type EmojiReaction ¶ added in v0.56.4
type EmojiReaction struct { protobuf.EmojiReaction // From is a public key of the author of the emoji reaction. From string `json:"from,omitempty"` // SigPubKey is the ecdsa encoded public key of the emoji reaction author SigPubKey *ecdsa.PublicKey `json:"-"` // LocalChatID is the chatID of the local chat (one-to-one are not symmetric) LocalChatID string `json:"localChatId"` }
EmojiReaction represents an emoji reaction from a user in the application layer, used for persistence, querying and signaling
func (EmojiReaction) GetProtobuf ¶ added in v0.56.4
func (e EmojiReaction) GetProtobuf() proto.Message
GetProtoBuf returns the struct's embedded protobuf struct this function is required to implement the ChatEntity interface
func (EmojiReaction) GetSigPubKey ¶ added in v0.56.4
func (e EmojiReaction) GetSigPubKey() *ecdsa.PublicKey
GetSigPubKey returns an ecdsa encoded public key this function is required to implement the ChatEntity interface
func (EmojiReaction) ID ¶ added in v0.56.4
func (e EmojiReaction) ID() string
ID is the Keccak256() contatenation of From-MessageID-EmojiType
func (EmojiReaction) MarshalJSON ¶ added in v0.56.4
func (e EmojiReaction) MarshalJSON() ([]byte, error)
func (*EmojiReaction) SetMessageType ¶ added in v0.56.4
func (e *EmojiReaction) SetMessageType(messageType protobuf.MessageType)
SetMessageType a setter for the MessageType field this function is required to implement the ChatEntity interface
func (EmojiReaction) WrapGroupMessage ¶ added in v0.69.0
func (e EmojiReaction) WrapGroupMessage() bool
WrapGroupMessage indicates whether we should wrap this in membership information
type EnvelopeEventsInterceptor ¶ added in v0.64.7
type EnvelopeEventsInterceptor struct { EnvelopeEventsHandler transport.EnvelopeEventsHandler Messenger *Messenger }
func (EnvelopeEventsInterceptor) EnvelopeExpired ¶ added in v0.64.7
func (interceptor EnvelopeEventsInterceptor) EnvelopeExpired(identifiers [][]byte, err error)
EnvelopeExpired triggered when envelope is expired but wasn't delivered to any peer.
func (EnvelopeEventsInterceptor) EnvelopeSent ¶ added in v0.64.7
func (interceptor EnvelopeEventsInterceptor) EnvelopeSent(identifiers [][]byte)
EnvelopeSent triggered when envelope delivered at least to 1 peer.
func (EnvelopeEventsInterceptor) MailServerRequestCompleted ¶ added in v0.64.7
func (interceptor EnvelopeEventsInterceptor) MailServerRequestCompleted(requestID types.Hash, lastEnvelopeHash types.Hash, cursor []byte, err error)
MailServerRequestCompleted triggered when the mailserver sends a message to notify that the request has been completed
func (EnvelopeEventsInterceptor) MailServerRequestExpired ¶ added in v0.64.7
func (interceptor EnvelopeEventsInterceptor) MailServerRequestExpired(hash types.Hash)
MailServerRequestExpired triggered when the mailserver request expires
type GroupChatInvitation ¶ added in v0.60.0
type GroupChatInvitation struct { protobuf.GroupChatInvitation // From is a public key of the author of the invitation request. From string `json:"from,omitempty"` // SigPubKey is the ecdsa encoded public key of the invitation author SigPubKey *ecdsa.PublicKey `json:"-"` }
Invitation represents a group chat invitation request from a user in the application layer, used for persistence, querying and signaling
func (GroupChatInvitation) GetProtobuf ¶ added in v0.60.0
func (g GroupChatInvitation) GetProtobuf() proto.Message
GetProtoBuf returns the struct's embedded protobuf struct this function is required to implement the ChatEntity interface
func (GroupChatInvitation) GetSigPubKey ¶ added in v0.60.0
func (g GroupChatInvitation) GetSigPubKey() *ecdsa.PublicKey
GetSigPubKey returns an ecdsa encoded public key this function is required to implement the ChatEntity interface
func (GroupChatInvitation) ID ¶ added in v0.60.0
func (g GroupChatInvitation) ID() string
ID is the Keccak256() contatenation of From-ChatId
func (GroupChatInvitation) MarshalJSON ¶ added in v0.60.0
func (g GroupChatInvitation) MarshalJSON() ([]byte, error)
type MailserverBatch ¶ added in v0.79.0
type MessageDeliveredHandler ¶ added in v0.71.5
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
func (*MessageHandler) HandleAcceptRequestAddressForTransaction ¶
func (m *MessageHandler) HandleAcceptRequestAddressForTransaction(messageState *ReceivedMessageState, command protobuf.AcceptRequestAddressForTransaction) error
func (*MessageHandler) HandleChatIdentity ¶ added in v0.65.0
func (m *MessageHandler) HandleChatIdentity(state *ReceivedMessageState, ci protobuf.ChatIdentity) error
HandleChatIdentity handles an incoming protobuf.ChatIdentity extracts contact information stored in the protobuf and adds it to the user's contact for update.
func (*MessageHandler) HandleChatMessage ¶
func (m *MessageHandler) HandleChatMessage(state *ReceivedMessageState) error
func (*MessageHandler) HandleCommunityDescription ¶ added in v0.67.0
func (m *MessageHandler) HandleCommunityDescription(state *ReceivedMessageState, signer *ecdsa.PublicKey, description protobuf.CommunityDescription, rawPayload []byte) error
HandleCommunityDescription handles an community description
func (*MessageHandler) HandleCommunityInvitation ¶ added in v0.67.0
func (m *MessageHandler) HandleCommunityInvitation(state *ReceivedMessageState, signer *ecdsa.PublicKey, invitation protobuf.CommunityInvitation, rawPayload []byte) error
HandleCommunityInvitation handles an community invitation
func (*MessageHandler) HandleCommunityRequestToJoin ¶ added in v0.72.0
func (m *MessageHandler) HandleCommunityRequestToJoin(state *ReceivedMessageState, signer *ecdsa.PublicKey, requestToJoinProto protobuf.CommunityRequestToJoin) error
HandleCommunityRequestToJoin handles an community request to join
func (*MessageHandler) HandleContactUpdate ¶
func (m *MessageHandler) HandleContactUpdate(state *ReceivedMessageState, message protobuf.ContactUpdate) error
func (*MessageHandler) HandleDeclineRequestAddressForTransaction ¶
func (m *MessageHandler) HandleDeclineRequestAddressForTransaction(messageState *ReceivedMessageState, command protobuf.DeclineRequestAddressForTransaction) error
func (*MessageHandler) HandleDeclineRequestTransaction ¶
func (m *MessageHandler) HandleDeclineRequestTransaction(messageState *ReceivedMessageState, command protobuf.DeclineRequestTransaction) error
func (*MessageHandler) HandleEmojiReaction ¶ added in v0.56.4
func (m *MessageHandler) HandleEmojiReaction(state *ReceivedMessageState, pbEmojiR protobuf.EmojiReaction) error
func (*MessageHandler) HandleGroupChatInvitation ¶ added in v0.60.0
func (m *MessageHandler) HandleGroupChatInvitation(state *ReceivedMessageState, pbGHInvitations protobuf.GroupChatInvitation) error
func (*MessageHandler) HandleMembershipUpdate ¶
func (m *MessageHandler) HandleMembershipUpdate(messageState *ReceivedMessageState, chat *Chat, rawMembershipUpdate protobuf.MembershipUpdateMessage, translations *systemMessageTranslationsMap) error
HandleMembershipUpdate updates a Chat instance according to the membership updates. It retrieves chat, if exists, and merges membership updates from the message. Finally, the Chat is updated with the new group events.
func (*MessageHandler) HandlePairInstallation ¶
func (m *MessageHandler) HandlePairInstallation(state *ReceivedMessageState, message protobuf.PairInstallation) error
func (*MessageHandler) HandlePinMessage ¶ added in v0.78.0
func (m *MessageHandler) HandlePinMessage(state *ReceivedMessageState, message protobuf.PinMessage) error
func (*MessageHandler) HandleRequestAddressForTransaction ¶
func (m *MessageHandler) HandleRequestAddressForTransaction(messageState *ReceivedMessageState, command protobuf.RequestAddressForTransaction) error
func (*MessageHandler) HandleRequestTransaction ¶
func (m *MessageHandler) HandleRequestTransaction(messageState *ReceivedMessageState, command protobuf.RequestTransaction) error
func (*MessageHandler) HandleSendTransaction ¶
func (m *MessageHandler) HandleSendTransaction(messageState *ReceivedMessageState, command protobuf.SendTransaction) error
func (*MessageHandler) HandleSyncInstallationContact ¶
func (m *MessageHandler) HandleSyncInstallationContact(state *ReceivedMessageState, message protobuf.SyncInstallationContact) error
func (*MessageHandler) HandleSyncInstallationPublicChat ¶
func (m *MessageHandler) HandleSyncInstallationPublicChat(state *ReceivedMessageState, message protobuf.SyncInstallationPublicChat) *Chat
type Messenger ¶
type Messenger struct {
// contains filtered or unexported fields
}
Messenger is a entity managing chats and messages. It acts as a bridge between the application and encryption layers. It needs to expose an interface to manage installations because installations are managed by the user. Similarly, it needs to expose an interface to manage mailservers because they can also be managed by the user.
func NewMessenger ¶
func (*Messenger) AcceptActivityCenterNotifications ¶ added in v0.76.0
func (m *Messenger) AcceptActivityCenterNotifications(ids []types.HexBytes) (*MessengerResponse, error)
func (*Messenger) AcceptAllActivityCenterNotifications ¶ added in v0.76.0
func (m *Messenger) AcceptAllActivityCenterNotifications() (*MessengerResponse, error)
func (*Messenger) AcceptRequestAddressForTransaction ¶
func (*Messenger) AcceptRequestToJoinCommunity ¶ added in v0.72.0
func (m *Messenger) AcceptRequestToJoinCommunity(request *requests.AcceptRequestToJoinCommunity) (*MessengerResponse, error)
func (*Messenger) AcceptRequestTransaction ¶
func (*Messenger) ActiveChats ¶ added in v0.76.0
func (*Messenger) ActivityCenterNotifications ¶ added in v0.76.0
func (m *Messenger) ActivityCenterNotifications(cursor string, limit uint64) (*ActivityCenterPaginationResponse, error)
func (*Messenger) AddAdminsToGroupChat ¶
func (*Messenger) AddContact ¶ added in v0.68.4
func (*Messenger) AddMailserver ¶
NOT IMPLEMENTED
func (*Messenger) AddMembersToGroupChat ¶
func (*Messenger) AddPushNotificationsServer ¶ added in v0.56.1
func (m *Messenger) AddPushNotificationsServer(ctx context.Context, publicKey *ecdsa.PublicKey, serverType pushnotificationclient.ServerType) error
AddPushNotificationsServer adds a push notification server
func (*Messenger) BanUserFromCommunity ¶ added in v0.73.9
func (m *Messenger) BanUserFromCommunity(request *requests.BanUserFromCommunity) (*MessengerResponse, error)
func (*Messenger) BlockContact ¶
func (*Messenger) ChangeGroupChatName ¶ added in v0.52.1
func (*Messenger) ClearHistory ¶ added in v0.68.4
func (m *Messenger) ClearHistory(request *requests.ClearHistory) (*MessengerResponse, error)
func (*Messenger) Communities ¶ added in v0.67.0
func (m *Messenger) Communities() ([]*communities.Community, error)
func (*Messenger) ConfirmJoiningGroup ¶
func (*Messenger) ConnectionChanged ¶ added in v0.79.0
func (m *Messenger) ConnectionChanged(state connection.State)
func (*Messenger) CreateCommunity ¶ added in v0.67.0
func (m *Messenger) CreateCommunity(request *requests.CreateCommunity) (*MessengerResponse, error)
func (*Messenger) CreateCommunityChat ¶ added in v0.67.0
func (m *Messenger) CreateCommunityChat(communityID types.HexBytes, c *protobuf.CommunityChat) (*MessengerResponse, error)
func (*Messenger) CreateGroupChatFromInvitation ¶ added in v0.60.0
func (*Messenger) CreateGroupChatWithMembers ¶
func (*Messenger) CreateOneToOneChat ¶ added in v0.72.0
func (m *Messenger) CreateOneToOneChat(request *requests.CreateOneToOneChat) (*MessengerResponse, error)
func (*Messenger) CreateProfileChat ¶ added in v0.79.0
func (m *Messenger) CreateProfileChat(request *requests.CreateProfileChat) (*MessengerResponse, error)
func (*Messenger) CreatePublicChat ¶ added in v0.79.0
func (m *Messenger) CreatePublicChat(request *requests.CreatePublicChat) (*MessengerResponse, error)
func (*Messenger) DeactivateChat ¶ added in v0.68.4
func (m *Messenger) DeactivateChat(request *requests.DeactivateChat) (*MessengerResponse, error)
func (*Messenger) DeclineRequestAddressForTransaction ¶
func (*Messenger) DeclineRequestToJoinCommunity ¶ added in v0.72.0
func (m *Messenger) DeclineRequestToJoinCommunity(request *requests.DeclineRequestToJoinCommunity) error
func (*Messenger) DeclineRequestTransaction ¶
func (*Messenger) DeleteChat ¶
func (*Messenger) DeleteMessage ¶
func (*Messenger) DeleteMessagesByChatID ¶
func (*Messenger) DisableInstallation ¶
func (*Messenger) DisablePushNotificationsBlockMentions ¶ added in v0.61.0
DisablePushNotificationsBlockMentions is used to indicate that we want to received push notifications for mentions
func (*Messenger) DisablePushNotificationsFromContactsOnly ¶ added in v0.56.1
DisablePushNotificationsFromContactsOnly is used to indicate that we want to received push notifications from anyone
func (*Messenger) DisableSendingPushNotifications ¶ added in v0.56.1
DisableSendingPushNotifications signals the client not to send any push notification
func (*Messenger) DismissActivityCenterNotifications ¶ added in v0.76.0
func (*Messenger) DismissAllActivityCenterNotifications ¶ added in v0.76.0
func (*Messenger) ENSVerified ¶ added in v0.72.0
func (*Messenger) EditCommunity ¶ added in v0.79.0
func (m *Messenger) EditCommunity(request *requests.EditCommunity) (*MessengerResponse, error)
func (*Messenger) EmojiReactionsByChatID ¶ added in v0.56.4
func (*Messenger) EnableInstallation ¶
func (*Messenger) EnablePushNotificationsBlockMentions ¶ added in v0.61.0
EnablePushNotificationsBlockMentions is used to indicate that we dont want to received push notifications for mentions
func (*Messenger) EnablePushNotificationsFromContactsOnly ¶ added in v0.56.1
EnablePushNotificationsFromContactsOnly is used to indicate that we want to received push notifications only from contacts
func (*Messenger) EnableSendingPushNotifications ¶ added in v0.56.1
EnableSendingPushNotifications signals the client to send push notifications
func (*Messenger) ExportCommunity ¶ added in v0.67.0
func (*Messenger) GetContactByID ¶ added in v0.44.2
GetContactByID assumes pubKey includes 0x prefix
func (*Messenger) GetGroupChatInvitations ¶ added in v0.60.0
func (m *Messenger) GetGroupChatInvitations() ([]*GroupChatInvitation, error)
func (*Messenger) GetPushNotificationsServers ¶ added in v0.59.0
func (m *Messenger) GetPushNotificationsServers() ([]*pushnotificationclient.PushNotificationServer, error)
GetPushNotificationsServers returns the servers used for push notifications
func (*Messenger) ImportCommunity ¶ added in v0.67.0
func (m *Messenger) ImportCommunity(key *ecdsa.PrivateKey) (*MessengerResponse, error)
func (*Messenger) Init ¶
Init analyzes chats and contacts in order to setup filters which are responsible for retrieving messages.
func (*Messenger) Installations ¶
func (m *Messenger) Installations() []*multidevice.Installation
func (*Messenger) InviteUsersToCommunity ¶ added in v0.72.0
func (m *Messenger) InviteUsersToCommunity(request *requests.InviteUsersToCommunity) (*MessengerResponse, error)
func (*Messenger) JoinCommunity ¶ added in v0.67.0
func (m *Messenger) JoinCommunity(communityID types.HexBytes) (*MessengerResponse, error)
func (*Messenger) JoinedCommunities ¶ added in v0.67.0
func (m *Messenger) JoinedCommunities() ([]*communities.Community, error)
func (*Messenger) LeaveCommunity ¶ added in v0.67.0
func (m *Messenger) LeaveCommunity(communityID types.HexBytes) (*MessengerResponse, error)
func (*Messenger) LeaveGroupChat ¶
func (*Messenger) LoadFilters ¶
func (*Messenger) MarkAllActivityCenterNotificationsRead ¶ added in v0.76.0
func (*Messenger) MarkAllRead ¶ added in v0.47.0
func (*Messenger) MarkMessagesSeen ¶
MarkMessagesSeen marks messages with `ids` as seen in the chat `chatID`. It returns the number of affected messages or error. If there is an error, the number of affected messages is always zero.
func (*Messenger) MessageByChatID ¶
func (*Messenger) MessagesExist ¶
func (*Messenger) MuteChat ¶ added in v0.56.1
MuteChat signals to the messenger that we don't want to be notified on new messages from this chat
func (*Messenger) MyPendingRequestsToJoin ¶ added in v0.72.0
func (m *Messenger) MyPendingRequestsToJoin() ([]*communities.RequestToJoin, error)
func (*Messenger) PendingRequestsToJoinForCommunity ¶ added in v0.72.0
func (m *Messenger) PendingRequestsToJoinForCommunity(id types.HexBytes) ([]*communities.RequestToJoin, error)
func (*Messenger) PinnedMessageByChatID ¶ added in v0.78.0
func (*Messenger) ReSendChatMessage ¶
ReSendChatMessage pulls a message from the database and sends it again
func (*Messenger) RegisterForPushNotifications ¶ added in v0.56.1
func (m *Messenger) RegisterForPushNotifications(ctx context.Context, deviceToken, apnTopic string, tokenType protobuf.PushNotificationRegistration_TokenType) error
RegisterForPushNotification register deviceToken with any push notification server enabled
func (*Messenger) RegisteredForPushNotifications ¶ added in v0.56.1
RegisteredForPushNotifications returns whether we successfully registered with all the servers
func (*Messenger) RemoveContact ¶ added in v0.68.4
func (*Messenger) RemoveFilters ¶
func (*Messenger) RemoveMailserver ¶
NOT IMPLEMENTED
func (*Messenger) RemoveMemberFromGroupChat ¶
func (*Messenger) RemovePushNotificationServer ¶ added in v0.56.1
func (m *Messenger) RemovePushNotificationServer(ctx context.Context, publicKey *ecdsa.PublicKey) error
RemovePushNotificationServer removes a push notification server
func (*Messenger) RemoveUserFromCommunity ¶ added in v0.67.0
func (*Messenger) RequestAddressForTransaction ¶
func (*Messenger) RequestAllHistoricMessages ¶ added in v0.79.0
func (m *Messenger) RequestAllHistoricMessages() (*MessengerResponse, error)
RequestAllHistoricMessages requests all the historic messages for any topic
func (*Messenger) RequestCommunityInfoFromMailserver ¶ added in v0.76.3
RequestCommunityInfoFromMailserver installs filter for community and requests its details from mailserver. When response received it will be passed through signals handler
func (*Messenger) RequestHistoricMessages ¶
func (*Messenger) RequestHistoricMessagesForFilter ¶ added in v0.76.3
func (*Messenger) RequestToJoinCommunity ¶ added in v0.72.0
func (m *Messenger) RequestToJoinCommunity(request *requests.RequestToJoinCommunity) (*MessengerResponse, error)
func (*Messenger) RequestTransaction ¶
func (*Messenger) RetrieveAll ¶
func (m *Messenger) RetrieveAll() (*MessengerResponse, error)
RetrieveAll retrieves messages from all filters, processes them and returns a MessengerResponse to the client
func (*Messenger) SaveContact ¶
func (*Messenger) SavePinMessages ¶ added in v0.78.0
func (m *Messenger) SavePinMessages(messages []*common.PinMessage) error
func (*Messenger) SelectMailserver ¶
NOT IMPLEMENTED
func (*Messenger) SendChatMessage ¶
func (m *Messenger) SendChatMessage(ctx context.Context, message *common.Message) (*MessengerResponse, error)
SendChatMessage takes a minimal message and sends it based on the corresponding chat
func (*Messenger) SendChatMessages ¶ added in v0.64.3
func (m *Messenger) SendChatMessages(ctx context.Context, messages []*common.Message) (*MessengerResponse, error)
SendChatMessages takes a array of messages and sends it based on the corresponding chats
func (*Messenger) SendContactUpdate ¶
func (m *Messenger) SendContactUpdate(ctx context.Context, chatID, ensName, profileImage string) (*MessengerResponse, error)
SendContactUpdate sends a contact update to a user and adds the user to contacts
func (*Messenger) SendContactUpdates ¶
func (m *Messenger) SendContactUpdates(ctx context.Context, ensName, profileImage string) (err error)
Send contact updates to all contacts added by us
func (*Messenger) SendEmojiReaction ¶ added in v0.56.4
func (m *Messenger) SendEmojiReaction(ctx context.Context, chatID, messageID string, emojiID protobuf.EmojiReaction_Type) (*MessengerResponse, error)
func (*Messenger) SendEmojiReactionRetraction ¶ added in v0.56.4
func (*Messenger) SendGroupChatInvitationRejection ¶ added in v0.60.0
func (*Messenger) SendGroupChatInvitationRequest ¶ added in v0.60.0
func (*Messenger) SendPairInstallation ¶
func (m *Messenger) SendPairInstallation(ctx context.Context) (*MessengerResponse, error)
SendPairInstallation sends a pair installation message
func (*Messenger) SendPinMessage ¶ added in v0.78.0
func (m *Messenger) SendPinMessage(ctx context.Context, message *common.PinMessage) (*MessengerResponse, error)
SendPinMessage sends the PinMessage to the corresponding chat
func (*Messenger) SendTransaction ¶
func (*Messenger) SetInstallationMetadata ¶
func (m *Messenger) SetInstallationMetadata(id string, data *multidevice.InstallationMetadata) error
func (*Messenger) SetMailserver ¶ added in v0.56.1
SetMailserver sets the currently used mailserver
func (*Messenger) ShareCommunity ¶ added in v0.72.0
func (m *Messenger) ShareCommunity(request *requests.ShareCommunity) (*MessengerResponse, error)
func (*Messenger) SignMessage ¶ added in v0.56.6
func (*Messenger) Start ¶
func (m *Messenger) Start() (*MessengerResponse, error)
func (*Messenger) StartPushNotificationsServer ¶ added in v0.56.1
StartPushNotificationsServer initialize and start a push notification server, using the current messenger identity key
func (*Messenger) StopPushNotificationsServer ¶ added in v0.56.1
StopPushNotificationServer stops the push notification server if running
func (*Messenger) SyncChatFromSyncedFrom ¶ added in v0.79.0
func (*Messenger) SyncDevices ¶
SyncDevices sends all public chats and contacts to paired devices TODO remove use of photoPath in contacts
func (*Messenger) UnmuteChat ¶ added in v0.56.1
UnmuteChat signals to the messenger that we want to be notified on new messages from this chat
func (*Messenger) UnreadActivityCenterNotificationsCount ¶ added in v0.76.0
func (*Messenger) UnregisterFromPushNotifications ¶ added in v0.56.1
UnregisterFromPushNotifications unregister from any server
func (*Messenger) UpdateMessageOutgoingStatus ¶
func (*Messenger) ValidateTransactions ¶
type MessengerResponse ¶
type MessengerResponse struct { Messages []*common.Message Contacts []*Contact Installations []*multidevice.Installation EmojiReactions []*EmojiReaction Invitations []*GroupChatInvitation CommunityChanges []*communities.CommunityChanges RequestsToJoinCommunity []*communities.RequestToJoin Mailservers []mailservers.Mailserver // contains filtered or unexported fields }
func (*MessengerResponse) ActivityCenterNotifications ¶ added in v0.76.0
func (r *MessengerResponse) ActivityCenterNotifications() []*ActivityCenterNotification
func (*MessengerResponse) AddActivityCenterNotification ¶ added in v0.76.0
func (r *MessengerResponse) AddActivityCenterNotification(n *ActivityCenterNotification)
func (*MessengerResponse) AddActivityCenterNotifications ¶ added in v0.76.0
func (r *MessengerResponse) AddActivityCenterNotifications(ns []*ActivityCenterNotification)
func (*MessengerResponse) AddChat ¶ added in v0.72.0
func (r *MessengerResponse) AddChat(c *Chat)
func (*MessengerResponse) AddChats ¶ added in v0.72.0
func (r *MessengerResponse) AddChats(chats []*Chat)
func (*MessengerResponse) AddCommunities ¶ added in v0.72.0
func (r *MessengerResponse) AddCommunities(communities []*communities.Community)
func (*MessengerResponse) AddCommunity ¶ added in v0.72.0
func (r *MessengerResponse) AddCommunity(c *communities.Community)
func (*MessengerResponse) AddMessage ¶ added in v0.79.0
func (r *MessengerResponse) AddMessage(message *common.Message)
func (*MessengerResponse) AddNotification ¶ added in v0.74.2
func (r *MessengerResponse) AddNotification(n *localnotifications.Notification)
func (*MessengerResponse) AddNotifications ¶ added in v0.74.2
func (r *MessengerResponse) AddNotifications(notifications []*localnotifications.Notification)
func (*MessengerResponse) AddPinMessage ¶ added in v0.78.0
func (r *MessengerResponse) AddPinMessage(pm *common.PinMessage)
func (*MessengerResponse) AddPinMessages ¶ added in v0.78.0
func (r *MessengerResponse) AddPinMessages(pms []*common.PinMessage)
func (*MessengerResponse) AddRemovedChat ¶ added in v0.72.0
func (r *MessengerResponse) AddRemovedChat(chatID string)
func (*MessengerResponse) AddRemovedChats ¶ added in v0.72.0
func (r *MessengerResponse) AddRemovedChats(chats []string)
func (*MessengerResponse) Chats ¶
func (r *MessengerResponse) Chats() []*Chat
func (*MessengerResponse) ClearNotifications ¶ added in v0.74.2
func (r *MessengerResponse) ClearNotifications()
func (*MessengerResponse) Communities ¶ added in v0.67.0
func (r *MessengerResponse) Communities() []*communities.Community
func (*MessengerResponse) IsEmpty ¶
func (r *MessengerResponse) IsEmpty() bool
func (*MessengerResponse) MarshalJSON ¶ added in v0.72.0
func (r *MessengerResponse) MarshalJSON() ([]byte, error)
func (*MessengerResponse) Merge ¶ added in v0.64.3
func (r *MessengerResponse) Merge(response *MessengerResponse) error
Merge takes another response and appends the new Chats & new Messages and replaces the existing Messages & Chats if they have the same ID
func (*MessengerResponse) Notifications ¶ added in v0.68.4
func (r *MessengerResponse) Notifications() []*localnotifications.Notification
func (*MessengerResponse) PinMessages ¶ added in v0.78.0
func (r *MessengerResponse) PinMessages() []*common.PinMessage
func (*MessengerResponse) RemovedChats ¶ added in v0.67.0
func (r *MessengerResponse) RemovedChats() []string
type MessengerSignalsHandler ¶ added in v0.76.3
type MessengerSignalsHandler interface { MessageDelivered(chatID string, messageID string) CommunityInfoFound(community *communities.Community) MessengerResponse(response *MessengerResponse) }
type NotificationBody ¶ added in v0.74.2
type NotificationBody struct { Message *common.Message `json:"message"` Contact *Contact `json:"contact"` Chat *Chat `json:"chat"` Community *communities.Community `json:"community"` }
func (NotificationBody) MarshalJSON ¶ added in v0.74.2
func (n NotificationBody) MarshalJSON() ([]byte, error)
type Option ¶
type Option func(*config) error
func WithAccount ¶ added in v0.65.0
func WithAccount(acc *multiaccounts.Account) Option
func WithCustomLogger ¶
func WithDatabase ¶
func WithDatabaseConfig ¶
func WithENSVerificationConfig ¶ added in v0.72.0
func WithENSVerificationConfig(onENSVerified func(*MessengerResponse), url, address string) Option
func WithEnvelopesMonitorConfig ¶
func WithEnvelopesMonitorConfig(emc *transport.EnvelopesMonitorConfig) Option
func WithMailserversDatabase ¶ added in v0.69.0
func WithMailserversDatabase(ma *mailservers.Database) Option
func WithMultiAccounts ¶ added in v0.65.0
func WithMultiAccounts(ma *multiaccounts.Database) Option
func WithPushNotificationClientConfig ¶ added in v0.56.1
func WithPushNotificationClientConfig(pushNotificationClientConfig *pushnotificationclient.Config) Option
func WithPushNotificationServerConfig ¶ added in v0.56.1
func WithPushNotificationServerConfig(pushNotificationServerConfig *pushnotificationserver.Config) Option
func WithSignalsHandler ¶ added in v0.76.3
func WithSignalsHandler(h MessengerSignalsHandler) Option
func WithSystemMessagesTranslations ¶
func WithSystemMessagesTranslations(t map[protobuf.MembershipUpdateEvent_EventType]string) Option
WithSystemMessagesTranslations is required for Group Chats which are currently disabled. nolint: unused
type ReceivedMessageState ¶
type ReceivedMessageState struct { // State on the message being processed CurrentMessageState *CurrentMessageState // AllChats in memory AllChats *chatMap // All contacts in memory AllContacts *contactMap // List of contacts modified ModifiedContacts *stringBoolMap // All installations in memory AllInstallations *installationMap // List of communities modified ModifiedInstallations *stringBoolMap // List of filters AllFilters map[string]*transport.Filter // Map of existing messages ExistingMessagesMap map[string]bool // EmojiReactions is a list of emoji reactions for the current batch // indexed by from-message-id-emoji-type EmojiReactions map[string]*EmojiReaction // GroupChatInvitations is a list of invitation requests or rejections GroupChatInvitations map[string]*GroupChatInvitation // Response to the client Response *MessengerResponse // Timesource is a time source for clock values/timestamps. Timesource common.TimeSource }
type TransactionToValidate ¶
type TransactionToValidate struct { TransactionHash string CommandID string MessageID string RetryCount int // First seen indicates the whisper timestamp of the first time we seen this FirstSeen uint64 // Validate indicates whether we should be validating this transaction Validate bool Signature []byte From *ecdsa.PublicKey }
type TransactionValidator ¶
type TransactionValidator struct {
// contains filtered or unexported fields
}
func NewTransactionValidator ¶
func (*TransactionValidator) ValidateTransaction ¶
func (t *TransactionValidator) ValidateTransaction(ctx context.Context, parameters *common.CommandParameters, from *ecdsa.PublicKey) (*VerifyTransactionResponse, error)
func (*TransactionValidator) ValidateTransactions ¶
func (t *TransactionValidator) ValidateTransactions(ctx context.Context) ([]*VerifyTransactionResponse, error)
type VerifyTransactionResponse ¶
type VerifyTransactionResponse struct { Pending bool // AccordingToSpec means that the transaction is valid, // the user should be notified, but is not the same as // what was requested, for example because the value is different AccordingToSpec bool // Valid means that the transaction is valid Valid bool // The actual value received Value string // The contract used in case of tokens Contract string // The address the transaction was actually sent Address string Message *common.Message Transaction *TransactionToValidate }
Source Files ¶
- activity_center.go
- activity_center_persistence.go
- chat.go
- chat_group_proxy.go
- contact.go
- emoji_reaction.go
- errors.go
- group_chat_invitation.go
- group_chat_system_messages.go
- local_notifications.go
- message_builder.go
- message_handler.go
- message_persistence.go
- message_validator.go
- messenger.go
- messenger_activity_center.go
- messenger_chats.go
- messenger_communities.go
- messenger_config.go
- messenger_contacts.go
- messenger_ens.go
- messenger_mailserver.go
- messenger_maps.go
- messenger_pin_messages.go
- messenger_response.go
- persistence.go
- transaction_validator.go
Directories ¶
Path | Synopsis |
---|---|
identity
|
|
internal
|
|
Package sqlite is responsible for creation of encrypted sqlite3 database using sqlcipher driver.
|
Package sqlite is responsible for creation of encrypted sqlite3 database using sqlcipher driver. |