chat

package
v0.184.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChatNotFound            = errors.New("can't find chat")
	ErrCommunitiesNotSupported = errors.New("communities are not supported")
	ErrChatTypeNotSupported    = errors.New("chat type not supported")
)

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(service *Service) *API

func (*API) AddMembers

func (api *API) AddMembers(ctx context.Context, communityID types.HexBytes, chatID string, members []string) (*GroupChatResponseWithInvitations, error)

func (*API) CreateGroupChat

func (api *API) CreateGroupChat(ctx context.Context, communityID types.HexBytes, name string, members []string) (*GroupChatResponse, error)

func (*API) CreateGroupChatFromInvitation

func (api *API) CreateGroupChatFromInvitation(communityID types.HexBytes, name string, chatID string, adminPK string) (*GroupChatResponse, error)

func (*API) CreateOneToOneChat

func (api *API) CreateOneToOneChat(ctx context.Context, communityID types.HexBytes, ID types.HexBytes, ensName string) (*CreateOneToOneChatResponse, error)

func (*API) EditChat added in v0.105.1

func (api *API) EditChat(ctx context.Context, communityID types.HexBytes, chatID string, name string, color string, image images.CroppedImage) (*protocol.MessengerResponse, error)

func (*API) GetGroupChatInvitations

func (api *API) GetGroupChatInvitations() ([]*protocol.GroupChatInvitation, error)

func (*API) LeaveChat

func (api *API) LeaveChat(ctx context.Context, communityID types.HexBytes, chatID string, remove bool) (*GroupChatResponse, error)

func (*API) MakeAdmin

func (api *API) MakeAdmin(ctx context.Context, communityID types.HexBytes, chatID string, member string) (*GroupChatResponse, error)

func (*API) RemoveMember

func (api *API) RemoveMember(ctx context.Context, communityID types.HexBytes, chatID string, member string) (*GroupChatResponse, error)

func (*API) RenameChat

func (api *API) RenameChat(ctx context.Context, communityID types.HexBytes, chatID string, name string) (*GroupChatResponse, error)

func (*API) SendAudio

func (api *API) SendAudio(ctx context.Context, communityID types.HexBytes, chatID string, audioPath string, responseTo string) (*SendMessageResponse, error)

func (*API) SendGroupChatInvitationRejection

func (api *API) SendGroupChatInvitationRejection(ctx context.Context, invitationRequestID string) ([]*protocol.GroupChatInvitation, error)

func (*API) SendGroupChatInvitationRequest

func (api *API) SendGroupChatInvitationRequest(ctx context.Context, communityID types.HexBytes, chatID string, adminPK string, message string) (*GroupChatResponseWithInvitations, error)

func (*API) SendImages

func (api *API) SendImages(ctx context.Context, communityID types.HexBytes, chatID string, imagePaths []string, text string, responseTo string) (*SendMessageResponse, error)

func (*API) SendMessage

func (api *API) SendMessage(ctx context.Context, communityID types.HexBytes, chatID string, text string, responseTo string) (*SendMessageResponse, error)

func (*API) SendSticker

func (api *API) SendSticker(ctx context.Context, communityID types.HexBytes, chatID string, packID int32, hash string, responseTo string) (*SendMessageResponse, error)

func (*API) StartGroupChat

func (api *API) StartGroupChat(ctx context.Context, communityID types.HexBytes, name string, members []string) (*StartGroupChatResponse, error)

type CreateOneToOneChatResponse

type CreateOneToOneChatResponse struct {
	Chat    *protocol.Chat    `json:"chat,omitempty"`
	Contact *protocol.Contact `json:"contact,omitempty"`
}

type GroupChatResponse

type GroupChatResponse struct {
	Chat     *protocol.Chat    `json:"chat"`
	Messages []*common.Message `json:"messages"`
}

type GroupChatResponseWithInvitations

type GroupChatResponseWithInvitations struct {
	Chat        *protocol.Chat                  `json:"chat"`
	Messages    []*common.Message               `json:"messages"`
	Invitations []*protocol.GroupChatInvitation `json:"invitations"`
}

type SendMessageResponse

type SendMessageResponse struct {
	Chat     *protocol.Chat    `json:"chat"`
	Messages []*common.Message `json:"messages"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(accountsDB *accounts.Database) *Service

func (*Service) APIs

func (s *Service) APIs() []gethrpc.API

func (*Service) Init

func (s *Service) Init(messenger *protocol.Messenger)

func (*Service) Protocols

func (s *Service) Protocols() []p2p.Protocol

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

type StartGroupChatResponse

type StartGroupChatResponse struct {
	Chat     *protocol.Chat      `json:"chat,omitempty"`
	Contacts []*protocol.Contact `json:"contacts"`
	Messages []*common.Message   `json:"messages,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL