tdproto

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 9 Imported by: 10

README

Documentation

Index

Constants

View Source
const (
	DirectChatType = ChatType("direct")
	GroupChatType  = ChatType("group")
	TaskChatType   = ChatType("task")
)
View Source
const (
	GroupAdmin  = GroupStatus("admin")  // 3
	GroupMember = GroupStatus("member") // 2
)
View Source
const (
	ContactPrefix        = "d-"
	GroupPrefix          = "g-"
	TaskPrefix           = "t-"
	ContactSectionPrefix = "sd-"
	GroupSectionPrefix   = "sg-"
	TaskSectionPrefix    = "st-"
)
View Source
const (
	PushDeviceAndroid = PushDeviceType(1)
	PushDeviceIOS     = PushDeviceType(2)
	PushDeviceWeb     = PushDeviceType(3)
	PushDeviceSafari  = PushDeviceType(4)
	PushDeviceIOSFB   = PushDeviceType(5)
)
View Source
const (
	TeamOwner  = TeamStatus("owner")
	TeamAdmin  = TeamStatus("admin")
	TeamMember = TeamStatus("member")
	TeamGuest  = TeamStatus("guest")
)
View Source
const (
	AuthBySecureCookie   = "cookie"
	AuthByInsecureCookie = "insecure cookie"
	AuthByToken          = "token"
	AuthByBotToken       = "bot token"
)

Variables

View Source
var AndroidPushDevices = []PushDeviceType{
	PushDeviceAndroid,
}

Functions

func ConfirmId added in v0.0.9

func ConfirmId() string

func Gentime added in v0.0.6

func Gentime() int64

func IsoDatetime added in v0.0.9

func IsoDatetime(dt time.Time) string

func NullableIsoDatetime added in v0.0.9

func NullableIsoDatetime(dt *time.Time) *string

func SourceDir added in v1.2.3

func SourceDir() string

func ValidUid added in v0.0.5

func ValidUid(s string) bool

Types

type AnyEvent added in v0.0.9

type AnyEvent struct {
	BaseEvent
	Params *map[string]interface{} `json:"params"`
}

func NewAnyEvent added in v0.0.9

func NewAnyEvent(name string) AnyEvent

type BaseEvent added in v0.0.9

type BaseEvent struct {
	Name      string `json:"event"`
	ConfirmId string `json:"confirm_id,omitempty"`
}

func (BaseEvent) GetConfirmId added in v0.0.9

func (ev BaseEvent) GetConfirmId() string

func (BaseEvent) GetName added in v0.0.9

func (ev BaseEvent) GetName() string

func (BaseEvent) String added in v0.0.9

func (ev BaseEvent) String() string

type CallDevice added in v0.0.8

type CallDevice struct {
	Muted     bool   `json:"muted"`
	Useragent string `json:"useragent"`
}

type CallEvent added in v0.0.8

type CallEvent struct {
	Start       *string       `json:"start"`
	Finish      *string       `json:"finish"`
	Audiorecord bool          `json:"audiorecord"`
	Onliners    []CallOnliner `json:"onliners"`
}

type CallOnliner added in v0.0.8

type CallOnliner struct {
	Jid         JID          `json:"jid"`
	Muted       bool         `json:"muted"`
	Devices     []CallDevice `json:"devices"`
	DisplayName string       `json:"display_name"`
	Icon        string       `json:"icon"`
}

type Chat added in v0.0.8

type Chat struct {
	ChatType                  ChatType          `json:"chat_type"`
	BaseGentime               int64             `json:"base_gentime,omitempty"`
	Gentime                   int64             `json:"gentime"`
	Created                   string            `json:"created"`
	Jid                       JID               `json:"jid"`
	DisplayName               string            `json:"display_name"`
	Icons                     *IconData         `json:"icons"`
	CountersEnabled           bool              `json:"counters_enabled,omitempty"`
	CanCall                   bool              `json:"can_call,omitempty"`
	CanSendMessage            bool              `json:"can_send_message,omitempty"`
	CantSendMessageReason     string            `json:"cant_send_message_reason,omitempty"`
	Collapsed                 bool              `json:"collapsed,omitempty"`
	Draft                     string            `json:"draft,omitempty"`
	DraftNum                  int64             `json:"draft_num,omitempty"`
	Hidden                    bool              `json:"hidden,omitempty"`
	NotificationsEnabled      bool              `json:"notifications_enabled,omitempty"`
	NumImportants             int               `json:"num_importants,omitempty"`
	NumUnread                 uint              `json:"num_unread,omitempty"`
	NumUnreadNotices          uint              `json:"num_unread_notices,omitempty"`
	LastMessage               *Message          `json:"last_message,omitempty"`
	LastReadMessageId         string            `json:"last_read_message_id,omitempty"`
	Section                   string            `json:"section,omitempty"`
	ChangeableFields          []string          `json:"changeable_fields,omitempty"`
	Pinned                    bool              `json:"pinned,omitempty"`
	PinnedSortOrdering        int               `json:"pinned_sort_ordering,omitempty"`
	NumMembers                *uint             `json:"num_members,omitempty"`
	CanDelete                 bool              `json:"can_delete,omitempty"`
	Description               string            `json:"description,omitempty"`
	Feed                      bool              `json:"feed,omitempty"`
	PinnedMessage             *Message          `json:"pinned_message,omitempty"`
	ColorIndex                *uint16           `chattype:"task" json:"color_index,omitempty"`
	NumItems                  *uint             `chattype:"task" json:"num_items,omitempty"`
	NumCheckedItems           *uint             `chattype:"task" json:"num_checked_items,omitempty"`
	Assignee                  *JID              `chattype:"task" json:"assignee,omitempty"`
	Num                       uint              `chattype:"task" json:"num,omitempty"`
	Observers                 *[]JID            `chattype:"task" json:"observers,omitempty"`
	Owner                     *JID              `chattype:"task" json:"owner,omitempty"`
	TaskStatus                string            `chattype:"task" json:"task_status,omitempty"`
	Title                     string            `chattype:"task" json:"title,omitempty"`
	Done                      string            `chattype:"task" json:"done,omitempty"`
	DoneReason                string            `chattype:"task" json:"done_reason,omitempty"`
	Deadline                  string            `chattype:"task" json:"deadline,omitempty"`
	DeadlineExpired           bool              `chattype:"task" json:"deadline_expired,omitempty"`
	Links                     MessageLinks      `chattype:"task" json:"links,omitempty"`
	Tags                      []string          `chattype:"task" json:"tags,omitempty"`
	Importance                *int              `chattype:"task" json:"importance,omitempty"`
	Urgency                   *int              `chattype:"task" json:"urgency,omitempty"`
	SpentTime                 *int              `chattype:"task" json:"spent_time,omitempty"`
	Complexity                *int              `chattype:"task" json:"complexity,omitempty"`
	LinkedMessages            []interface{}     `chattype:"task" json:"linked_messages,omitempty"`
	Items                     []TaskItem        `chattype:"task" json:"items,omitempty"`
	Parents                   []Subtask         `chattype:"task" json:"parents,omitempty"`
	Tabs                      *[]TaskTabKey     `chattype:"task" json:"tabs,omitempty"`
	Status                    GroupStatus       `chattype:"group" json:"status,omitempty"`
	Members                   []GroupMembership `chattype:"group" json:"members,omitempty"`
	CanAddMember              bool              `chattype:"group" json:"can_add_member,omitempty"`
	CanRemoveMember           bool              `chattype:"group" json:"can_remove_member,omitempty"`
	CanChangeMemberStatus     bool              `chattype:"group" json:"can_change_member_status,omitempty"`
	CanChangeSettings         bool              `chattype:"group" json:"can_change_settings,omitempty"` // deprecated: use changeable fields
	DefaultForAll             bool              `chattype:"group" json:"default_for_all,omitempty"`
	ReadonlyForMembers        bool              `chattype:"group" json:"readonly_for_members,omitempty"`
	AutocleanupAge            *int              `chattype:"group" json:"autocleanup_age,omitempty"`
	Public                    bool              `chattype:"group,task" json:"public,omitempty"`
	CanJoin                   bool              `chattype:"group,task" json:"can_join,omitempty"`
	CanDeleteAnyMessage       *bool             `json:"can_delete_any_message,omitempty"`
	CanSetImportantAnyMessage *bool             `json:"can_set_important_any_message,omitempty"`
}

type ChatCounters added in v0.0.7

type ChatCounters struct {
	Jid                JID      `json:"jid"`
	ChatType           ChatType `json:"chat_type"`
	Gentime            int64    `json:"gentime"`
	NumUnread          uint     `json:"num_unread"`
	NumUnreadNotices   uint     `json:"num_unread_notices"`
	LastReadMessageUid *string  `json:"last_read_message_id"`
}

type ChatMessages added in v0.0.8

type ChatMessages struct {
	Messages []Message `json:"messages"`
}

type ChatShort added in v0.2.0

type ChatShort struct {
	Jid         JID       `json:"jid"`
	DisplayName string    `json:"display_name"`
	Icons       *IconData `json:"icons"`
	ChatType    ChatType  `json:"chat_type"`
}

type ChatType added in v0.0.4

type ChatType string

func (ChatType) IsDirect added in v0.0.4

func (ct ChatType) IsDirect() bool

func (ChatType) IsGroup added in v0.0.4

func (ct ChatType) IsGroup() bool

func (ChatType) IsTask added in v0.0.4

func (ct ChatType) IsTask() bool

func (ChatType) JidPrefix added in v0.0.4

func (ct ChatType) JidPrefix() string

func (ChatType) String added in v0.0.4

func (ct ChatType) String() string

type ClientActivity added in v0.0.11

type ClientActivity struct {
	BaseEvent
	Params clientActivityParams `json:"params"`
}

func NewClientActivity added in v0.1.1

func NewClientActivity(afk bool) (r ClientActivity)

type ClientCallBuzz added in v0.0.9

type ClientCallBuzz struct {
	BaseEvent
	Params clientCallBuzzParams `json:"params"`
}

deprecated: use http api

type ClientCallBuzzCancel added in v0.0.10

type ClientCallBuzzCancel struct {
	BaseEvent
	Params clientCallBuzzCancelParams `json:"params"`
}

deprecated: use http api

type ClientCallLeave added in v0.0.9

type ClientCallLeave struct {
	BaseEvent
	Params clientCallLeaveParams `json:"params"`
}

deprecated: use http api

type ClientCallMuteAll added in v0.0.9

type ClientCallMuteAll struct {
	BaseEvent
	Params clientCallMuteAllParams `json:"params"`
}

deprecated: use http api

type ClientCallOffer added in v0.0.9

type ClientCallOffer struct {
	BaseEvent
	Params clientCallOfferParams `json:"params"`
}

deprecated: use http api

type ClientCallReject added in v0.0.9

type ClientCallReject struct {
	BaseEvent
	Params clientCallRejectParams `json:"params"`
}

deprecated: use http api

type ClientCallSound added in v0.0.9

type ClientCallSound struct {
	BaseEvent
	Params clientCallSoundParams `json:"params"`
}

deprecated: use http api

type ClientCallTrickle added in v0.0.9

type ClientCallTrickle struct {
	BaseEvent
	Params clientCallTrickleParams `json:"params"`
}

deprecated: use http api

type ClientChatComposing added in v0.0.11

type ClientChatComposing struct {
	BaseEvent
	Params clientChatComposingParams `json:"params"`
}

func NewClientChatComposing added in v0.1.1

func NewClientChatComposing(jid JID, composing bool, draft *string) (r ClientChatComposing)

type ClientChatLastread added in v0.0.11

type ClientChatLastread struct {
	BaseEvent
	Params clientChatLastreadParams `json:"params"`
}

func NewClientChatLastread added in v0.1.1

func NewClientChatLastread(jid JID, messageId *string) (r ClientChatLastread)

type ClientConfirm added in v0.0.11

type ClientConfirm struct {
	BaseEvent
	Params clientConfirmParams `json:"params"`
}

func NewClientConfirm added in v0.0.13

func NewClientConfirm(confirmId string) (r ClientConfirm)

type ClientMessageDeleted added in v0.0.11

type ClientMessageDeleted struct {
	BaseEvent
	Params clientMessageDeletedParams `json:"params"`
}

func NewClientMessageDeleted added in v0.0.13

func NewClientMessageDeleted(messageId string) (r ClientMessageDeleted)

type ClientMessageUpdated added in v0.0.9

type ClientMessageUpdated struct {
	BaseEvent
	Params ClientMessageUpdatedParams `json:"params"`
}

func NewClientMessageUpdated added in v0.0.13

func NewClientMessageUpdated(p ClientMessageUpdatedParams) (r ClientMessageUpdated)

type ClientMessageUpdatedParams added in v0.0.9

type ClientMessageUpdatedParams struct {
	// chat, task or contact jid. Required.
	To JID `json:"to"`

	// message content. Required.
	Content MessageContent `json:"content"`

	// uid created by client. Recommended.
	MessageId string `json:"message_id,omitempty"`

	// Replied to message id. Not required.
	ReplyTo string `json:"reply_to,omitempty"`

	// forwarded messages (previously was for reply too). Not required.
	LinkedMessages []string `json:"linked_messages,omitempty"`

	// important flag. Not required. Default: false
	Important bool `json:"important,omitempty"`

	// disable links preview generation. Not required. Default: false
	Nopreview bool `json:"nopreview,omitempty"`

	// deprecated
	Comment string `json:"comment,omitempty"`
}

type ClientPing added in v0.0.11

type ClientPing struct {
	BaseEvent
}

func NewClientPing added in v0.0.13

func NewClientPing() (r ClientPing)

type ColorRule added in v0.0.8

type ColorRule struct {
	Uid                   string   `json:"uid"`
	Priority              int      `json:"priority"`
	ColorIndex            uint16   `json:"color_index"`
	Section               string   `json:"section,omitempty"`
	Tags                  []string `json:"tags,omitempty"`
	Description           string   `json:"description,omitempty"`
	TaskStatus            string   `json:"task_status,omitempty"`
	TaskImportance        *int     `json:"task_importance,omitempty"`
	TaskUrgency           *int     `json:"task_urgency,omitempty"`
	SectionEnabled        *bool    `json:"section_enabled,omitempty"`
	TaskImportanceEnabled *bool    `json:"task_importance_enabled,omitempty"`
	TaskUrgencyEnabled    *bool    `json:"task_urgency_enabled,omitempty"`
	TagsEnabled           *bool    `json:"tags_enabled,omitempty"`
}

type Contact added in v0.0.7

type Contact struct {
	DisplayName     string     `json:"display_name"`
	ShortName       string     `json:"short_name"`
	ContactEmail    string     `json:"contact_email"`
	ContactPhone    string     `json:"contact_phone"`
	Icons           *IconData  `json:"icons"`
	Jid             JID        `json:"jid"`
	Role            string     `json:"role"`
	Mood            string     `json:"mood,omitempty"`
	TeamStatus      TeamStatus `json:"status"`
	LastActivity    *string    `json:"last_activity"`
	AddToTeamRights bool       `json:"add_to_team_rights,omitempty"`
	IsArchive       bool       `json:"is_archive,omitempty"`
	Botname         string     `json:"botname,omitempty"`
	Sections        []string   `json:"sections"`
	// actor:
	CanSendMessage        *bool     `json:"can_send_message,omitempty"`
	CantSendMessageReason string    `json:"cant_send_message_reason,omitempty"`
	CanCall               *bool     `json:"can_call,omitempty"`
	CanCreateTask         *bool     `json:"can_create_task,omitempty"`
	CanAddToGroup         *bool     `json:"can_add_to_group,omitempty"`
	CanDelete             *bool     `json:"can_delete,omitempty"`
	ChangeableFields      *[]string `json:"changeable_fields,omitempty"`
	FamilyName            *string   `json:"family_name,omitempty"`
	GivenName             *string   `json:"given_name,omitempty"`
	Patronymic            *string   `json:"patronymic,omitempty"`
	DefaultLang           *string   `json:"default_lang,omitempty"`
	// self:
	DebugShowActivity         *bool   `json:"debug_show_activity,omitempty"`
	DropallEnabled            *bool   `json:"dropall_enabled,omitempty"`
	AltSend                   *bool   `json:"alt_send,omitempty"`
	AlwaysSendPushes          *bool   `json:"always_send_pushes,omitempty"`
	Timezone                  *string `json:"timezone,omitempty"`
	QuietTimeStart            *string `json:"quiet_time_start,omitempty"`
	QuietTimeFinish           *string `json:"quiet_time_finish,omitempty"`
	GroupNotificationsEnabled *bool   `json:"group_notifications_enabled,omitempty"`
	TaskNotificationsEnabled  *bool   `json:"task_notifications_enabled,omitempty"`
	ContactShortView          *bool   `json:"contact_short_view,omitempty"`
	GroupShortView            *bool   `json:"group_short_view,omitempty"`
	TaskShortView             *bool   `json:"task_short_view,omitempty"`
	ContactMshortView         *bool   `json:"contact_mshort_view,omitempty"`
	ContactShowArchived       *bool   `json:"contact_show_archived,omitempty"`
	GroupMshortView           *bool   `json:"group_mshort_view,omitempty"`
	TaskMshortView            *bool   `json:"task_mshort_view,omitempty"`
	UnreadFirst               *bool   `json:"unread_first,omitempty"`
	MUnreadFirst              *bool   `json:"munread_first,omitempty"`
	// admin fields:
	CanAddToTeam          *bool `json:"can_add_to_team,omitempty"`
	CanManageSections     *bool `json:"can_manage_sections,omitempty"`
	CanManageTags         *bool `json:"can_manage_tags,omitempty"`
	CanManageIntegrations *bool `json:"can_manage_integrations,omitempty"`
	CanManageColorRules   *bool `json:"can_manage_color_rules,omitempty"`
	CanCreateGroup        *bool `json:"can_create_group,omitempty"`
	CanJoinPublicGroups   *bool `json:"can_join_public_groups,omitempty"`
	CanJoinPublicTasks    *bool `json:"can_join_public_tasks,omitempty"`
	CanDeleteAnyMessage   *bool `json:"can_delete_any_message,omitempty"` // deprecated
	// custom fields:
	CustomFields *ContactCustomFields `json:"custom_fields,omitempty"`
}

type ContactCustomFields added in v0.0.7

type ContactCustomFields struct {
	Company     string `json:"company,omitempty"`
	Department  string `json:"department,omitempty"`
	Title       string `json:"title,omitempty"`
	MobilePhone string `json:"mobile_phone,omitempty"`
}

type ContactPreview added in v0.0.7

type ContactPreview struct {
	Error      string `json:"_error,omitempty"`
	Phone      string `json:"phone"`
	GivenName  string `json:"given_name"`
	FamilyName string `json:"family_name"`
	Patronymic string `json:"patronymic,omitempty"`
	Role       string `json:"role"`
	Section    string `json:"section"`
}

type ContactShort added in v0.2.0

type ContactShort struct {
	DisplayName string    `json:"display_name"`
	ShortName   string    `json:"short_name"`
	Icons       *IconData `json:"icons"`
	Jid         JID       `json:"jid"`
}

type Country added in v0.0.8

type Country struct {
	Code    string `json:"code"`
	Name    string `json:"name"`
	Default bool   `json:"default,omitempty"`
	Popular bool   `json:"popular,omitempty"`
}

type DeletedChat added in v0.0.8

type DeletedChat struct {
	Jid       JID      `json:"jid"`
	ChatType  ChatType `json:"chat_type"`
	Gentime   int64    `json:"gentime"`
	IsArchive bool     `json:"is_archive"`
}

type DeletedRemind added in v0.0.8

type DeletedRemind struct {
	Uid string `json:"uid"`
}

type DeletedSection added in v0.0.8

type DeletedSection struct {
	Uid string `json:"uid"`
}

type DeletedTag added in v0.0.8

type DeletedTag struct {
	Uid string `json:"uid"`
}

type DeletedTeam added in v0.0.7

type DeletedTeam struct {
	Uid       string `json:"uid"`
	IsArchive bool   `json:"is_archive"`
	Gentime   int64  `json:"gentime"`
}

type Dist added in v0.0.8

type Dist struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type Event added in v0.0.9

type Event interface {
	GetName() string
	GetConfirmId() string
}

type Features

type Features struct {
	// current host
	Host string `json:"host"`

	// build/revision of server side
	Build string `json:"build"`

	// desktop application version
	DesktopVersion string `json:"desktop_version"`

	// webclient version
	FrontVersion string `json:"front_version"`

	// Application title
	AppTitle string `json:"app_title"`

	// Static files server address
	Userver string `json:"userver"`

	// Link to AppStore
	IOSApp string `json:"ios_app"`

	// Link to Google Play
	AndroidApp string `json:"android_app"`

	// Default UI theme
	Theme string `json:"theme"`

	// Minimal application version required for this server. Used for breaking changes
	MinAppVersion string `json:"min_app_version"`

	// Free registration allowed
	FreeRegistration bool `json:"free_registration"`

	// Maximum size of user's upload
	MaxUploadMb int `json:"max_upload_mb"`

	// Maximum number of forwarded messages
	MaxLinkedMessages int `json:"max_linked_messages"`

	// Maximum chars for: family_name, given_name, patronymic if any
	MaxUsernamePartLength int `json:"max_username_part_length"`

	// Maximum chars for group chat name
	MaxGroupTitleLength int `json:"max_group_title_length"`

	// Maximum chars for role in team
	MaxRoleLength int `json:"max_role_length"`

	// Maximum chars for mood in team
	MaxMoodLength int `json:"max_mood_length"`

	// Maximum chars for text message
	MaxMessageLength int `json:"max_message_length"`

	// Maximum length for project and contact's sections names
	MaxSectionLength int `json:"max_section_length"`

	// Maximum length for tags
	MaxTagLength int `json:"max_tag_length"`

	// Maximum length for task title
	MaxTaskTitleLength int `json:"max_task_title_length"`

	// Maximum teams for one account
	MaxTeams int `json:"max_teams"`

	// Max inactivity seconds
	AfkAge int `json:"afk_age"`

	// Password authentication enabled
	AuthByPassword bool `json:"auth_by_password,omitempty"`

	// QR-code / link authentication enabled
	AuthByQrCode bool `json:"auth_by_qr_code,omitempty"`

	// SMS authentication enabled
	AuthBySms bool `json:"auth_by_sms,omitempty"`

	// Calls functions enabled
	Calls bool `json:"calls"`

	// Calls functions enabled for mobile applications
	MoblieCalls bool `json:"mobile_calls"`

	// Calls record enabled
	CallsRecord bool `json:"calls_record"`

	// ICE servers for WebRTC
	ICEServers []ICEServer `json:"ice_servers"`

	// True for onpremise installation
	CustomServer bool `json:"custom_server"`

	// name of instalation
	InstallationType string `json:"installation_type"`

	// testing installation
	IsTesting bool `json:"is_testing"`

	// yandex metrika counter id
	Metrika string `json:"metrika"`

	// minimal chars number for starting global search
	MinSearchLength int `json:"min_search_length"`

	// resend message in n seconds if no confirmation from server given
	ResendTimeout int `json:"resend_timeout"`

	// frontent sentry.io settings
	SentryDsnJS string `json:"sentry_dsn_js"`

	// message drafts saved on server
	ServerDrafts bool `json:"server_drafts"`

	// web-push notifacations related fields
	FirebaseAppId    string `json:"firebase_app_id"`
	FirebaseSenderId string `json:"firebase_sender_id"`
	SafariPushId     string `json:"safari_push_id"`

	// experimetal functions
	Terms                Terms `json:"terms"`
	SingleGroupTeams     bool  `json:"single_group_teams"`
	WikiPages            bool  `json:"wiki_pages"`
	AllowAdminMute       bool  `json:"allow_admin_mute,omitempty"`
	OnlyOneDevicePerCall bool  `json:"only_one_device_per_call,omitempty"`

	// obsolete fields. Always true
	TaskChecklist  bool `json:"task_checklist"`
	ReadonlyGroups bool `json:"readonly_groups"`
	TaskDashboard  bool `json:"task_dashboard"`
	TaskMessages   bool `json:"task_messages"`
	TaskPublic     bool `json:"task_public"`
	TaskTags       bool `json:"task_tags"`
}

{hostname}/features.js / {hostname}/features.json structure

type GroupAccessRequest added in v0.0.8

type GroupAccessRequest struct {
	Uid     string `json:"uid"`
	Created string `json:"created"`
	Subject *JID   `json:"subject"`
}

type GroupMembership added in v0.0.8

type GroupMembership struct {
	Jid       *JID        `json:"jid"`
	Status    GroupStatus `json:"status"`
	CanRemove bool        `json:"can_remove,omitempty"`
}

type GroupStatus added in v0.0.8

type GroupStatus string

type HasJid added in v0.0.4

type HasJid interface {
	JID() *JID
}

type ICEServer

type ICEServer struct {
	Urls string `json:"urls"`
}

type IconData added in v0.0.7

type IconData struct {
	// Small icon
	Sm *SingleIcon `json:"sm,omitempty"`

	// Large image
	Lg *SingleIcon `json:"lg,omitempty"`

	// Generated image with 1-2 letters
	Stub string `json:"stub,omitempty"`

	// Letters from stub icon
	Letters string `json:"letters,omitempty"`

	// Stub icon background color
	Color string `json:"color,omitempty"`
}

Icon data. Contains sm+lg (for uploaded image) OR stub+letters+color (for icon generated from display name)

func (*IconData) SmUrlOrStub added in v0.0.7

func (d *IconData) SmUrlOrStub() string

type Integration added in v0.0.8

type Integration struct {
	Comment string          `json:"comment"`
	Created string          `json:"created,omitempty"`
	Enabled bool            `json:"enabled"`
	Form    IntegrationForm `json:"form"`
	Group   *JID            `json:"group,omitempty"`
	Title   string          `json:"-"`
	Help    string          `json:"help,omitempty"`
	Kind    string          `json:"kind"`
	Uid     string          `json:"uid,omitempty"`
}

type IntegrationField added in v0.0.8

type IntegrationField struct {
	Label    string `json:"label"`
	Readonly bool   `json:"readonly"`
	Value    string `json:"value"`
}

type IntegrationForm added in v0.0.8

type IntegrationForm struct {
	ApiKey     *IntegrationField `json:"api_key,omitempty"`
	WebhookUrl *IntegrationField `json:"webhook_url,omitempty"`
	Url        *IntegrationField `json:"url,omitempty"`
}

type IntegrationKind added in v0.0.8

type IntegrationKind struct {
	Kind     string      `json:"kind"`
	Template Integration `json:"template"`
	Title    string      `json:"title"`
}

type IntegrationKindList added in v0.0.8

type IntegrationKindList []IntegrationKind

type IntegrationList added in v0.0.8

type IntegrationList []Integration

type Integrations added in v0.0.8

type Integrations struct {
	Integrations IntegrationList     `json:"integrations"`
	Kinds        IntegrationKindList `json:"kinds"`
}

type Invitation added in v0.0.8

type Invitation struct {
	Uid     string `json:"uid"`
	Token   string `json:"token"`
	Created string `json:"created"`
	Qr      string `json:"qr"`
}

type JID added in v0.0.4

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

func NewJID added in v0.0.4

func NewJID(val string) *JID

func (JID) ChatType added in v0.0.4

func (jid JID) ChatType() ChatType

func (JID) Empty added in v0.0.4

func (jid JID) Empty() bool

func (JID) Equal added in v0.0.4

func (jid JID) Equal(other JID) bool

func (JID) IsDirect added in v0.0.4

func (jid JID) IsDirect() bool

func (JID) IsGroup added in v0.0.4

func (jid JID) IsGroup() bool

func (JID) IsSection added in v0.0.4

func (jid JID) IsSection() bool

func (JID) IsTask added in v0.0.4

func (jid JID) IsTask() bool

func (JID) JID added in v0.0.4

func (jid JID) JID() *JID

func (JID) MarshalJSON added in v0.0.4

func (jid JID) MarshalJSON() ([]byte, error)

func (JID) String added in v0.0.4

func (jid JID) String() string

func (JID) Uid added in v0.0.4

func (jid JID) Uid() string

func (*JID) UnmarshalJSON added in v0.0.4

func (jid *JID) UnmarshalJSON(data []byte) error

func (JID) Valid added in v0.0.4

func (jid JID) Valid() bool

func (JID) Value added in v0.0.4

func (jid JID) Value() string

type JIDs added in v0.0.4

type JIDs []JID

type JSEP added in v0.0.9

type JSEP struct {
	SDP  string `json:"sdp"`
	Type string `json:"type"`
}

type Mediasubtype added in v0.0.4

type Mediasubtype string
const (
	MediaSubtypeSticker Mediasubtype = "sticker"
	MediaSubtypeNewtask Mediasubtype = "newtask"
)

type Mediatype added in v0.0.4

type Mediatype string
const (
	MediatypePlain    Mediatype = "plain"
	MediatypeChange   Mediatype = "change"
	MediatypeDeleted  Mediatype = "deleted"
	MediatypeFile     Mediatype = "file"
	MediatypeImage    Mediatype = "image"
	MediatypeVideo    Mediatype = "video"
	MediatypeAudiomsg Mediatype = "audiomsg"
	MediatypeContact  Mediatype = "contact"
	MediatypePdf      Mediatype = "pdf"
)

type Message added in v0.0.4

type Message struct {
	// message content struct
	Content MessageContent `json:"content"`

	// simple plaintext message representation
	PushText string `json:"push_text,omitempty"`

	// sender jid
	From JID `json:"from"`

	// recipient jid
	To JID `json:"to"`

	// message uid
	MessageId string `json:"message_id"`

	// message creation datetime (set by server side)
	Created string `json:"created"`

	// object version
	Gentime int64 `json:"gentime"`

	// chat type
	ChatType ChatType `json:"chat_type"`

	// chat jid
	Chat JID `json:"chat,omitempty"`

	// external/internals links
	Links MessageLinks `json:"links,omitempty"`

	// importance flag
	Important bool `json:"important,omitempty"`

	// datetime of message modification or deletion
	Edited string `json:"edited,omitempty"`

	// message was seen by anybody in chat. True or null
	Received bool `json:"received,omitempty"`

	// unused yet
	NumReceived int `json:"num_received,omitempty"`

	// disable link previews. True or null
	Nopreview bool `json:"nopreview,omitempty"`

	// has link previews. True or null
	HasPreviews bool `json:"has_previews,omitempty"`

	// previous message id in this chat. Uid or null
	Prev string `json:"prev,omitempty"`

	// this message is first in this chat. True or null
	IsFirst bool `json:"is_first,omitempty"`

	// this message is first in this chat. True or null
	IsLast bool `json:"is_last,omitempty"`

	// message reactions struct. Can be null
	Reactions []MessageReaction `json:"reactions,omitempty"`

	// message that was replied to, if any
	ReplyTo *Message `json:"reply_to,omitempty"`

	// forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility
	LinkedMessages []Message `json:"linked_messages,omitempty"`

	// has mention (@). True or null
	Notice bool `json:"notice,omitempty"`

	// message has no pushes and did not affect any counters
	Silently bool `json:"silently,omitempty"`

	// author can change this message until date. Can be null
	EditableUntil string `json:"editable_until,omitempty"`

	// index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted.
	Num *int `json:"num,omitempty"`

	// debug information if any
	Debug string `json:"_debug,omitempty"`
}

type MessageContent added in v0.0.4

type MessageContent struct {
	Text          string       `json:"text"`
	Type          Mediatype    `json:"type"`
	Subtype       Mediasubtype `json:"subtype,omitempty"`
	Upload        string       `mediatype:"audiomsg,image,video,file" json:"upload,omitempty"`
	MediaUrl      string       `mediatype:"audiomsg,image,video,file" json:"mediaURL,omitempty"`
	Size          int          `mediatype:"audiomsg,image,video,file" json:"size,omitempty"`
	Duration      *uint        `mediatype:"audiomsg,video" json:"duration,omitempty"`
	Processing    bool         `mediatype:"video" json:"processing,omitempty"`
	PreviewHeight int          `mediatype:"image,video" json:"previewHeight,omitempty"`
	PreviewWidth  int          `mediatype:"image,video" json:"previewWidth,omitempty"`
	PreviewUrl    string       `mediatype:"image,video" json:"previewURL,omitempty"`
	Preview2xUrl  string       `mediatype:"image,video" json:"preview2xURL,omitempty"`
	Name          string       `mediatype:"image,video,file" json:"name,omitempty"`
	Animated      bool         `mediatype:"image" json:"animated,omitempty"`
	Title         string       `mediatype:"change" json:"title,omitempty"`
	New           *string      `mediatype:"change" json:"new,omitempty"`
	Old           *string      `mediatype:"change" json:"old,omitempty"`
	Actor         *JID         `mediatype:"change" json:"actor,omitempty"`
	Comment       string       `mediatype:"progress" json:"comment,omitempty"`
	I             uint         `mediatype:"progress" json:"i,omitempty"`
	Total         uint         `mediatype:"progress" json:"total,omitempty"`
	GivenName     *string      `mediatype:"contact" json:"given_name,omitempty"`
	FamilyName    *string      `mediatype:"contact" json:"family_name,omitempty"`
	Patronymic    *string      `mediatype:"contact" json:"patronymic,omitempty"`
	Phones        *[]string    `mediatype:"contact" json:"phones,omitempty"`
	Emails        *[]string    `mediatype:"contact" json:"emails,omitempty"`
	Stickerpack   string       `mediasubtype:"sticker" json:"stickerpack,omitempty"`
	PdfVersion    *PdfVersion  `json:"pdf_version,omitempty"`
}
type MessageLink struct {
	// Text fragment that should be replaced by link
	Pattern string `json:"pattern"`

	// Internal (tadateam://) or external link
	Url string `json:"url"`

	// Text replacement.
	Text string `json:"text"`

	// Optional preview info, for websites
	Preview *MessageLinkPreview `json:"preview,omitempty"`

	// Optional upload info
	Uploads []Upload `json:"uploads,omitempty"`

	// Website previews disabled
	NoPreview bool `json:"nopreview,omitempty"`

	// Optional youtube movie id
	YoutubeId string `json:"youtube_id,omitempty"`
}

Checked message links. In short: "Click here: {link.Pattern}" => "Click here: <a href='{link.Url}'>{link.Text}</a>"

type MessageLinkPreview added in v0.0.4

type MessageLinkPreview struct {
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
}

Website title and description

type MessageLinks []MessageLink

func (MessageLinks) Sort added in v0.0.4

func (links MessageLinks) Sort()

type MessagePush added in v0.0.9

type MessagePush struct {
	Title       string `json:"title"`
	Subtitle    string `json:"subtitle"`
	Message     string `json:"message"`
	IconUrl     string `json:"icon_url"`
	ClickAction string `json:"click_action"`
	Tag         string `json:"tag"`
	Team        string `json:"team"`
	Sender      *JID   `json:"sender"`
	Chat        *JID   `json:"chat"`
	MessageId   string `json:"message_id"`
	Created     string `json:"created"`
}

type MessageReaction added in v0.0.4

type MessageReaction struct {
	Name    string                  `json:"name"`
	Counter int                     `json:"counter"`
	Details []MessageReactionDetail `json:"details"`
}

type MessageReactionDetail added in v0.0.4

type MessageReactionDetail struct {
	Created string `json:"created"`
	Sender  *JID   `json:"sender"`
	Name    string `json:"name"`
}

type OnlineCall added in v0.0.9

type OnlineCall struct {
	Jid JID    `json:"jid"`
	Uid string `json:"uid"`
}

type OnlineContact added in v0.0.9

type OnlineContact struct {
	Jid    JID  `json:"jid"`
	Afk    bool `json:"afk,omitempty"`
	Mobile bool `json:"mobile"` // TODO: omitempty. 17feb2020
}

type PaginatedChats added in v0.0.8

type PaginatedChats struct {
	Contacts []Contact `json:"contacts,omitempty"`
	Objects  []Chat    `json:"objects"`
	Count    int       `json:"count"`
	Limit    int       `json:"limit"`
	Offset   int       `json:"offset"`
}

type PaginatedContacts added in v0.0.8

type PaginatedContacts struct {
	Objects []Contact `json:"objects"`
	Count   int       `json:"count"`
	Limit   int       `json:"limit"`
	Offset  int       `json:"offset"`
}

type PaginatedMessages added in v0.0.8

type PaginatedMessages struct {
	Objects []Message `json:"objects"`
	Count   int       `json:"count"`
	Limit   int       `json:"limit"`
	Offset  int       `json:"offset"`
}

type PdfVersion added in v0.0.4

type PdfVersion struct {
	Url         string `json:"url"`
	TextPreview string `json:"text_preview,omitempty"`
}

type PushDevice added in v0.0.8

type PushDevice struct {
	Type                 string `json:"type"`
	DeviceId             string `json:"device_id"`
	NotifictionToken     string `json:"notification_token"`
	VoipNotifictionToken string `json:"voip_notification_token"`
	AllowedNotifications bool   `json:"allowed_notifications"` // deprecated
	Name                 string `json:"name"`
	DataPushes           bool   `json:"data_pushes"`
	DataBadges           bool   `json:"data_badges"`
}

type PushDeviceType added in v0.0.8

type PushDeviceType int

func (PushDeviceType) DbValue added in v0.0.8

func (t PushDeviceType) DbValue() int16

func (PushDeviceType) Mobile added in v0.0.8

func (t PushDeviceType) Mobile() bool

func (PushDeviceType) Name added in v0.0.8

func (t PushDeviceType) Name() string

func (PushDeviceType) String added in v0.0.8

func (t PushDeviceType) String() string

type ReceivedMessage added in v0.0.9

type ReceivedMessage struct {
	Chat        JID    `json:"chat"`
	MessageId   string `json:"message_id"`
	Received    bool   `json:"received"`
	NumReceived int    `json:"num_received,omitempty"`
	Debug       string `json:"_debug,omitempty"`
}

type Remind added in v0.0.8

type Remind struct {
	Uid     string `json:"uid"`
	Chat    *JID   `json:"chat"`
	FireAt  string `json:"fire_at"`
	Comment string `json:"comment,omitempty"`
}

type Roster added in v0.0.8

type Roster struct {
	Badge           *uint        `json:"badge"`            // TODO: ,omitempty
	ContactSections []Section    `json:"contact_sections"` // TODO: ,omitempty
	Contacts        []Contact    `json:"contacts"`         // TODO: ,omitempty
	Devices         []PushDevice `json:"devices"`          // TODO: ,omitempty
	Groups          []Chat       `json:"groups"`           // TODO: ,omitempty
	DirectChats     []Chat       `json:"direct_chats"`     // TODO: ,omitempty
	GroupSections   []Section    `json:"group_sections"`   // TODO: ,omitempty
	TaskChats       []Chat       `json:"task_chats"`       // TODO: ,omitempty
	TaskSections    []Section    `json:"task_sections"`    // TODO: ,omitempty
	TaskTabs        []TaskTab    `json:"task_tabs"`        // TODO: ,omitempty
}

deprecated

type Section added in v0.0.8

type Section struct {
	Uid          string `json:"uid"`
	SortOrdering uint   `json:"sort_ordering"`
	Name         string `json:"name"`
	Gentime      int64  `json:"gentime"`
	Description  string `json:"description,omitempty"`
	IsArchive    bool   `json:"is_archive,omitempty"`
}

type ServerCallAnswer added in v0.0.9

type ServerCallAnswer struct {
	BaseEvent
	Params serverCallAnswerParams `json:"params"`
}

func NewServerCallAnswer added in v0.0.9

func NewServerCallAnswer(jid JID, sdp string, onliners []CallOnliner, uid string) (r ServerCallAnswer)

type ServerCallBuzz added in v0.0.9

type ServerCallBuzz struct {
	BaseEvent
	Params serverCallBuzzParams `json:"params"`
}

func NewServerCallBuzz added in v0.0.9

func NewServerCallBuzz(teamShort TeamShort, chatShort ChatShort, actorShort ContactShort, uid string, timeout time.Duration) (r ServerCallBuzz)

type ServerCallBuzzcancel added in v0.0.9

type ServerCallBuzzcancel struct {
	BaseEvent
	Params serverCallBuzzcancelParams `json:"params"`
}

func NewServerCallBuzzcancel added in v0.0.9

func NewServerCallBuzzcancel(chat *JID, teamUid string, uid string) (r ServerCallBuzzcancel)

type ServerCallCheckFingerprint added in v0.0.9

type ServerCallCheckFingerprint struct {
	BaseEvent
	Params serverCallCheckFingerprintParams `json:"params"`
}

func NewServerCallCheckFingerprint added in v0.0.9

func NewServerCallCheckFingerprint(fingerprint string) (r ServerCallCheckFingerprint)

type ServerCallLeave added in v0.0.9

type ServerCallLeave struct {
	BaseEvent
	Params serverCallLeaveParams `json:"params"`
}

func NewServerCallLeave added in v0.0.9

func NewServerCallLeave(jid JID, uid string) (r ServerCallLeave)

type ServerCallMuteall added in v0.0.9

type ServerCallMuteall struct {
	BaseEvent
	Params serverCallMuteallParams `json:"params"`
}

func NewServerCallMuteall added in v0.0.9

func NewServerCallMuteall(jid JID, muted bool, error string) (r ServerCallMuteall)

type ServerCallReject added in v0.0.9

type ServerCallReject struct {
	BaseEvent
	Params serverCallRejectParams `json:"params"`
}

func NewServerCallReject added in v0.0.9

func NewServerCallReject(jid JID, reason string, uid string) (r ServerCallReject)

type ServerCallRestart added in v0.0.9

type ServerCallRestart struct {
	BaseEvent
	Params serverCallRestartParams `json:"params"`
}

func NewServerCallRestart added in v0.0.9

func NewServerCallRestart(chat *JID, teamUid string, uid string) (r ServerCallRestart)

type ServerCallSound added in v0.0.9

type ServerCallSound struct {
	BaseEvent
	Params serverCallSoundParams `json:"params"`
}

func NewServerCallSound added in v0.0.9

func NewServerCallSound(jid JID, muted bool) (r ServerCallSound)

type ServerCallState added in v0.0.9

type ServerCallState struct {
	BaseEvent
	Params serverCallStateParams `json:"params"`
}

func NewServerCallState added in v0.0.9

func NewServerCallState(chat HasJid, startCall, finishCall *time.Time, onliners []CallOnliner, audiorecord, buzz bool, uid string, timestamp int64) (r ServerCallState)

type ServerCallTalking added in v0.0.9

type ServerCallTalking struct {
	BaseEvent
	Params serverCallTalkingParams `json:"params"`
}

func NewServerCallTalking added in v0.0.9

func NewServerCallTalking(talking bool, chat, actor *JID) (r ServerCallTalking)

type ServerChatComposing added in v0.0.9

type ServerChatComposing struct {
	BaseEvent
	Params serverChatComposingParams `json:"params"`
}

func NewServerChatComposing added in v0.0.9

func NewServerChatComposing(composing, isAudio bool, chat, actor *JID) (r ServerChatComposing)

type ServerChatDeleted added in v0.0.9

type ServerChatDeleted struct {
	BaseEvent
	Params serverChatDeletedParams `json:"params"`
}

func NewServerChatDeleted added in v0.0.9

func NewServerChatDeleted(chat DeletedChat, teamUnread *TeamUnread, badge uint) (r ServerChatDeleted)

type ServerChatDraft added in v0.0.9

type ServerChatDraft struct {
	BaseEvent
	Params serverChatDraftParams `json:"params"`
}

func NewServerChatDraft added in v0.0.9

func NewServerChatDraft(jid *JID, draft string, draftNum int64) (r ServerChatDraft)

type ServerChatLastread added in v0.0.9

type ServerChatLastread struct {
	BaseEvent
	Params serverChatLastreadParams `json:"params"`
}

func NewServerChatLastread added in v0.0.9

func NewServerChatLastread(counters ChatCounters, teamUnread *TeamUnread, badge uint) (r ServerChatLastread)

type ServerChatUpdated added in v0.0.9

type ServerChatUpdated struct {
	BaseEvent
	Params serverChatUpdatedParams `json:"params"`
}

func NewServerChatUpdated added in v0.0.9

func NewServerChatUpdated(chat Chat, teamUnread *TeamUnread, badge uint) (r ServerChatUpdated)

type ServerConfirm added in v0.0.9

type ServerConfirm struct {
	BaseEvent
	Params serverConfirmParams `json:"params"`
}

func NewServerConfirm added in v0.0.9

func NewServerConfirm(v string) (r ServerConfirm)

type ServerContactUpdated added in v0.0.9

type ServerContactUpdated struct {
	BaseEvent
	Params serverContactUpdatedParams `json:"params"`
}

func NewServerContactUpdated added in v0.0.9

func NewServerContactUpdated(contacts ...Contact) (r ServerContactUpdated)

type ServerDebug added in v0.0.9

type ServerDebug struct {
	BaseEvent
	Params serverDebugParams `json:"params"`
}

func NewServerDebug added in v0.0.9

func NewServerDebug(text string) (r ServerDebug)

type ServerLogin added in v0.0.9

type ServerLogin struct {
	BaseEvent
	Params serverLoginParams `json:"params"`
}

func NewServerLogin added in v0.0.9

func NewServerLogin(deviceName string) (r ServerLogin)

type ServerMessagePush added in v0.0.9

type ServerMessagePush struct {
	BaseEvent
	Params MessagePush `json:"params"`
}

func NewServerMessagePush added in v0.0.9

func NewServerMessagePush(p MessagePush) (r ServerMessagePush)

type ServerMessageReceived added in v0.0.9

type ServerMessageReceived struct {
	BaseEvent
	Params serverMessageReceivedParams `json:"params"`
}

func NewServerMessageReceived added in v0.0.9

func NewServerMessageReceived(messages []ReceivedMessage) (r ServerMessageReceived)

type ServerMessageUpdated added in v0.0.9

type ServerMessageUpdated struct {
	BaseEvent
	Params serverMessageUpdatedParams `json:"params"`
}

func NewServerMessageUpdated added in v0.0.9

func NewServerMessageUpdated(messages []Message, delayed bool, counters *ChatCounters, teamUnread *TeamUnread, badge *uint) (r ServerMessageUpdated)

type ServerOnline added in v0.0.9

type ServerOnline struct {
	BaseEvent
	Params serverOnlineParams `json:"params"`
}

func NewServerOnline added in v0.0.9

func NewServerOnline(contacts []OnlineContact, calls []OnlineCall) (r ServerOnline)

type ServerPanic added in v0.0.9

type ServerPanic struct {
	BaseEvent
	Params serverPanicParams `json:"params"`
}

func NewServerPanic added in v0.0.9

func NewServerPanic(code string) (r ServerPanic)

type ServerProcessing added in v0.0.9

type ServerProcessing struct {
	BaseEvent
	Params serverProcessingParams `json:"params"`
}

func NewServerProcessing added in v0.0.9

func NewServerProcessing(num, total int, action, message string, hasError bool) (r ServerProcessing)

type ServerRemindDeleted added in v0.0.9

type ServerRemindDeleted struct {
	BaseEvent
	Params serverRemindDeletedParams `json:"params"`
}

func NewServerRemindDeleted added in v0.0.9

func NewServerRemindDeleted(uid string) (r ServerRemindDeleted)

type ServerRemindFired added in v0.0.9

type ServerRemindFired struct {
	BaseEvent
	Params serverRemindFiredParams `json:"params"`
}

func NewServerRemindFired added in v0.0.9

func NewServerRemindFired(remind Remind) (r ServerRemindFired)

type ServerRemindUpdated added in v0.0.9

type ServerRemindUpdated struct {
	BaseEvent
	Params serverRemindUpdatedParams `json:"params"`
}

func NewServerRemindUpdated added in v0.0.9

func NewServerRemindUpdated(remind Remind) (r ServerRemindUpdated)

type ServerRoster added in v0.0.9

type ServerRoster struct {
	BaseEvent
	Params Roster `json:"params"`
}

deprecated

func NewServerRoster added in v0.0.9

func NewServerRoster(roster Roster) (r ServerRoster)

deprecated

type ServerSectionDeleted added in v0.0.9

type ServerSectionDeleted struct {
	BaseEvent
	Params serverSectionDeletedParams `json:"params"`
}

func NewServerSectionDeleted added in v0.0.9

func NewServerSectionDeleted(ct ChatType, section DeletedSection) (r ServerSectionDeleted)

type ServerSectionUpdated added in v0.0.9

type ServerSectionUpdated struct {
	BaseEvent
	Params serverSectionUpdatedParams `json:"params"`
}

func NewServerSectionUpdated added in v0.0.9

func NewServerSectionUpdated(ct ChatType, sections ...Section) (r ServerSectionUpdated)

type ServerTagDeleted added in v0.0.9

type ServerTagDeleted struct {
	BaseEvent
	Params serverTagDeletedParams `json:"params"`
}

func NewServerTagDeleted added in v0.0.9

func NewServerTagDeleted(tags ...DeletedTag) (r ServerTagDeleted)

type ServerTagUpdated added in v0.0.9

type ServerTagUpdated struct {
	BaseEvent
	Params serverTagUpdatedParams `json:"params"`
}

func NewServerTagUpdated added in v0.0.9

func NewServerTagUpdated(tags ...Tag) (r ServerTagUpdated)

type ServerTeamCounters added in v0.0.9

type ServerTeamCounters struct {
	BaseEvent
	Params serverTeamCountersParams `json:"params"`
}

func NewServerTeamCounters added in v0.0.9

func NewServerTeamCounters(counters []TeamCounter, badge uint) ServerTeamCounters

TODO: remove empty

type ServerTeamDeleted added in v0.0.9

type ServerTeamDeleted struct {
	BaseEvent
	Params serverTeamDeletedParams `json:"params"`
}

func NewServerTeamDeleted added in v0.0.9

func NewServerTeamDeleted(uid string, gentime int64) (r ServerTeamDeleted)

type ServerTeamUpdated added in v0.0.9

type ServerTeamUpdated struct {
	BaseEvent
	Params serverTeamUpdatedParams `json:"params"`
}

func NewServerTeamUpdated added in v0.0.9

func NewServerTeamUpdated(team Team) (r ServerTeamUpdated)

type ServerTime added in v0.0.9

type ServerTime struct {
	BaseEvent
	Params serverTimeParams `json:"params"`
}

func NewServerTime added in v0.0.9

func NewServerTime() (r ServerTime)

type ServerUiSettings added in v0.0.9

type ServerUiSettings struct {
	BaseEvent
	Params *UiSettings `json:"params"`
}

func NewServerUiSettings added in v0.0.9

func NewServerUiSettings(v *UiSettings) (r ServerUiSettings)

type ServerWarning added in v0.0.9

type ServerWarning struct {
	BaseEvent
	Params serverWarningParams `json:"params"`
}

func NewServerWarning added in v0.0.9

func NewServerWarning(message, orig string) (r ServerWarning)

type SimpleDailyIntStats added in v1.1.0

type SimpleDailyIntStats map[time.Time]int

type SingleIcon added in v0.0.7

type SingleIcon struct {
	// absolute url to icon
	Url string `json:"url"`

	// Icon width, in pixels
	Width int `json:"width"`

	// Icon height, in pixels
	Height int `json:"height"`
}

Small or large icon

type Sticker added in v1.2.4

type Sticker struct {
	Uid            string         `json:"uid"`
	Icon64         string         `json:"icon64"`
	Icon100        string         `json:"icon100"`
	Icon128        string         `json:"icon128"`
	Icon200        string         `json:"icon200"`
	MessageContent MessageContent `json:"message_content"`
}

type Stickerpack added in v1.2.4

type Stickerpack struct {
	Uid        string    `json:"uid"`
	Name       string    `json:"name"`
	Title      string    `json:"title"`
	Author     string    `json:"author,omitempty"`
	AuthorLink string    `json:"author_link,omitempty"`
	Stickers   []Sticker `json:"stickers"`
}

type Subtask added in v0.0.8

type Subtask struct {
	Jid         JID    `json:"jid"`
	Assignee    JID    `json:"assignee"`
	Title       string `json:"title"`
	Num         uint   `json:"num"`
	DisplayName string `json:"display_name"`
	Public      bool   `json:"public,omitempty"`
}

type Tag added in v0.0.8

type Tag struct {
	Name string `json:"name"`
	Uid  string `json:"uid"`
}

type TaskColor added in v0.0.8

type TaskColor struct {
	Regular string `json:"regular"`
	Dark    string `json:"dark"`
	Light   string `json:"light"`
}

type TaskFilter added in v0.0.8

type TaskFilter struct {
	Field TaskFilterKey `json:"field"`
	Title string        `json:"title"`
}

type TaskFilterKey added in v0.0.8

type TaskFilterKey string

func (TaskFilterKey) String added in v0.0.8

func (key TaskFilterKey) String() string

type TaskItem added in v0.0.8

type TaskItem struct {
	Uid          string   `json:"uid,omitempty"`
	SortOrdering uint     `json:"sort_ordering,omitempty"`
	Text         string   `json:"text"`
	Checked      bool     `json:"checked,omitempty"`
	CanToggle    bool     `json:"can_toggle,omitempty"`
	Subtask      *Subtask `json:"subtask,omitempty"`
}

type TaskItems added in v0.0.8

type TaskItems struct {
	Name    string `json:"name"`
	Checked bool   `json:"checked"`
}

type TaskPreview added in v0.0.8

type TaskPreview struct {
	Error       string      `json:"_error,omitempty"`
	Assignee    JID         `json:"assignee"`
	Deadline    *time.Time  `json:"deadline"`
	Description string      `json:"description"`
	Section     string      `json:"section"`
	Public      bool        `json:"public"`
	Tags        []string    `json:"tags"`
	Items       []TaskItems `json:"items"`
}

type TaskSort added in v0.0.8

type TaskSort struct {
	Key   TaskSortKey `json:"key"`
	Title string      `json:"title"`
}

type TaskSortKey added in v0.0.8

type TaskSortKey string

type TaskStatus added in v0.0.8

type TaskStatus struct {
	Uid          string `json:"uid,omitempty"`
	SortOrdering uint   `json:"sort_ordering"`
	Name         string `json:"name"`
	Title        string `json:"title"`
	IsArchive    bool   `json:"is_archive,omitempty"`
}

type TaskTab added in v0.0.8

type TaskTab struct {
	Key         TaskTabKey   `json:"key"`
	Title       string       `json:"title"`
	HideEmpty   bool         `json:"hide_empty"`
	ShowCounter bool         `json:"show_counter"`
	Pagination  bool         `json:"pagination"`
	Filters     []TaskFilter `json:"filters"`
	Sort        []TaskSort   `json:"sort"`
}

type TaskTabKey added in v0.0.8

type TaskTabKey string

type Team added in v0.0.7

type Team struct {
	Uid                    string       `json:"uid"`
	IsArchive              bool         `json:"is_archive,omitempty"`
	Gentime                int64        `json:"gentime"`
	Name                   string       `json:"name"`
	DefaultTaskDeadline    string       `json:"default_task_deadline,omitempty"`
	MaxMessageUpdateAge    int          `json:"max_message_update_age"`
	Icons                  *IconData    `json:"icons"`
	LastActive             bool         `json:"last_active"`
	ChangeableStatuses     []TeamStatus `json:"changeable_statuses,omitempty"`
	BadProfile             bool         `json:"bad_profile,omitempty"`
	NeedConfirmation       bool         `json:"need_confirmation"`
	UsePatronymic          bool         `json:"use_patronymic,omitempty"`
	UseTaskImportance      bool         `json:"use_task_importance,omitempty"`
	TaskImportanceMin      int          `json:"task_importance_min,omitempty"`
	TaskImportanceMax      int          `json:"task_importance_max,omitempty"`
	TaskImportanceRev      bool         `json:"task_importance_rev,omitempty"`
	UseTaskUrgency         bool         `json:"use_task_urgency,omitempty"`
	UseTaskComplexity      bool         `json:"use_task_complexity,omitempty"`
	UseTaskSpentTime       bool         `json:"use_task_spent_time,omitempty"`
	DisplayFamilyNameFirst bool         `json:"display_family_name_first,omitempty"`
	UserFields             []string     `json:"user_fields"`
	UploadsSize            int64        `json:"uploads_size,omitempty"`
	UploadsSizeLimit       int64        `json:"uploads_size_limit,omitempty"`
	Unreads                *TeamUnread  `json:"unread"`
	Me                     Contact      `json:"me,omitempty"`
	Contacts               []Contact    `json:"contacts,omitempty"`
	SingleGroup            *JID         `json:"single_group,omitempty"`
	Theme                  *Theme       `json:"theme,omitempty"`
	HideArchivedUsers      bool         `json:"hide_archived_users,omitempty"`
}

type TeamCounter added in v0.0.7

type TeamCounter struct {
	Uid     string     `json:"uid"`
	Unreads TeamUnread `json:"unread"`
}

type TeamPreview added in v0.0.7

type TeamPreview struct {
	Name  string    `json:"name"`
	Icons *IconData `json:"icons"`
}

type TeamShort added in v0.2.0

type TeamShort struct {
	Uid   string    `json:"uid"`
	Name  string    `json:"name"`
	Icons *IconData `json:"icons"`
}

type TeamStatus added in v0.0.7

type TeamStatus string

type TeamUnread added in v0.0.7

type TeamUnread map[ChatType]*Unread

func EmptyTeamUnread added in v0.0.7

func EmptyTeamUnread() TeamUnread

func (TeamUnread) Empty added in v0.0.7

func (unread TeamUnread) Empty() bool

type Terms

type Terms struct {
	EnInTeam       string
	EnTeam         string
	EnTeamAccess   string
	EnTeamAdmin    string
	EnTeamAdmins   string
	EnTeamGuest    string
	EnTeamMember   string
	EnTeamMembers  string
	EnTeamOwner    string
	EnTeamSettings string
	RuTeamSettings string
	EnTeams        string
	EnToTeam       string
	RuInTeam       string
	RuTeam         string
	RuTeamAccess   string
	RuTeamAdmin    string
	RuTeamAdmins   string
	RuTeamD        string
	RuTeamGuest    string
	RuTeamMember   string
	RuTeamMembers  string
	RuTeamOwner    string
	RuTeamP        string
	RuTeamR        string
	RuTeams        string
	RuTeamsD       string
	RuTeamsP       string
	RuTeamsR       string
	RuTeamsT       string
	RuTeamsV       string
	RuTeamT        string
	RuTeamV        string
	RuToTeam       string
}

type Theme added in v0.0.7

type Theme struct {
	BgColor                string
	BgHoverColor           string
	TextColor              string
	MutedTextColor         string
	AccentColor            string
	AccentHoverColor       string
	TextOnAccentHoverColor string
	MainAccent             string
	MainAccentHover        string
	MainLightAccent        string
	MainLink               string
	AppAccentColor         string
	AppPrimaryColor        string
}

type UiSettings added in v0.0.9

type UiSettings map[string]interface{}

type Unread added in v0.0.7

type Unread struct {
	NumMessages       uint `json:"messages"`
	NumNoticeMessages uint `json:"notice_messages"`
	NumChats          uint `json:"chats"`
}

type Upload added in v0.0.4

type Upload struct {
	Uid         string         `json:"uid"`
	Size        int            `json:"size"`
	Duration    uint           `json:"duration,omitempty"`
	Name        string         `json:"name"`
	Url         string         `json:"url"`
	Preview     *UploadPreview `json:"preview,omitempty"`
	ContentType string         `json:"content_type"`
	Animated    bool           `json:"animated,omitempty"`
	Processing  bool           `json:"processing,omitempty"`
	PdfVersion  *PdfVersion    `json:"pdf_version,omitempty"`
}

type UploadPreview added in v0.0.4

type UploadPreview struct {
	Url    string `json:"url"`
	Url2x  string `json:"url_2x"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type User added in v0.0.8

type User struct {
	Phone            *string `json:"phone"`
	Email            *string `json:"email"`
	DefaultLang      *string `json:"default_lang"`
	AltSend          bool    `json:"alt_send"`
	AlwaysSendPushes bool    `json:"always_send_pushes"`
	UnreadFirst      bool    `json:"unread_first"`
	MUnreadFirst     bool    `json:"munread_first"`
	Timezone         string  `json:"timezone"`
	QuietTimeStart   *string `json:"quiet_time_start"`
	QuietTimeFinish  *string `json:"quiet_time_finish"`
}

type UserAuth added in v0.0.8

type UserAuth struct {
	Created    time.Time `json:"created"`
	LastAccess time.Time `json:"last_access,omitempty"`
	DebugAge   int       `json:"_age,omitempty"`
	Uid        string    `json:"uid"`
	Kind       string    `json:"kind"`
	Device     string    `json:"device,omitempty"`
}

type UserWithMe added in v0.0.8

type UserWithMe struct {
	User
	Inviter *JID         `json:"inviter,omitempty"`
	Teams   []Team       `json:"teams"`
	Devices []PushDevice `json:"devices"`
}

type WikiPage added in v0.0.8

type WikiPage struct {
	Gentime int64  `json:"gentime"`
	Updated string `json:"updated"`
	Editor  JID    `json:"editor"`
	Text    string `json:"text"`
}

Source Files

Directories

Path Synopsis
tools
gen-tdpoto-ts command

Jump to

Keyboard shortcuts

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