messaging

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxText         = 2000
	MessagesPerPage = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID               int64
	AuthorID         *int64
	Text             string
	IsNew            bool
	CanDelete        bool
	Date             time.Time
	CanReply         bool
	DialogCount      int32
	AllMessagesLink  bool
	ToUserID         int64
	DialogWithUserID int64
}

type Options

type Options struct {
	AllMessagesLink bool
}

type Repository

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

func NewRepository

func NewRepository(db *goqu.Database, telegramService *telegram.Service) *Repository

func (*Repository) ClearSent

func (s *Repository) ClearSent(ctx context.Context, userID int64) error

func (*Repository) ClearSystem

func (s *Repository) ClearSystem(ctx context.Context, userID int64) error

func (*Repository) CreateMessage

func (s *Repository) CreateMessage(ctx context.Context, fromUserID int64, toUserID int64, text string) error

func (*Repository) DeleteMessage

func (s *Repository) DeleteMessage(ctx context.Context, userID int64, messageID int64) error

func (*Repository) GetDialogCount

func (s *Repository) GetDialogCount(ctx context.Context, userID int64, withUserID int64) (int32, error)

func (*Repository) GetDialogbox

func (s *Repository) GetDialogbox(
	ctx context.Context,
	userID int64,
	withUserID int64,
	page int32,
) ([]Message, *util.Pages, error)

func (*Repository) GetInbox

func (s *Repository) GetInbox(ctx context.Context, userID int64, page int32) ([]Message, *util.Pages, error)

func (*Repository) GetInboxCount

func (s *Repository) GetInboxCount(ctx context.Context, userID int64) (int32, error)

func (*Repository) GetInboxNewCount

func (s *Repository) GetInboxNewCount(ctx context.Context, userID int64) (int32, error)

func (*Repository) GetSentCount

func (s *Repository) GetSentCount(ctx context.Context, userID int64) (int32, error)

func (*Repository) GetSentbox

func (s *Repository) GetSentbox(ctx context.Context, userID int64, page int32) ([]Message, *util.Pages, error)

func (*Repository) GetSystemCount

func (s *Repository) GetSystemCount(ctx context.Context, userID int64) (int32, error)

func (*Repository) GetSystemNewCount

func (s *Repository) GetSystemNewCount(ctx context.Context, userID int64) (int32, error)

func (*Repository) GetSystembox

func (s *Repository) GetSystembox(ctx context.Context, userID int64, page int32) ([]Message, *util.Pages, error)

func (*Repository) GetUserNewMessagesCount

func (s *Repository) GetUserNewMessagesCount(ctx context.Context, userID int64) (int32, error)

Jump to

Keyboard shortcuts

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