tdproto

package module
v0.0.10 Latest Latest
Warning

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

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

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 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"`
	Unimportant bool   `json:"_unimportant,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) IsUnimportant added in v0.0.9

func (ev BaseEvent) IsUnimportant() bool

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"`
	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                  string            `chattype:"task" json:"assignee,omitempty"`
	Num                       uint              `chattype:"task" json:"num,omitempty"`
	Observers                 *[]string         `chattype:"task" json:"observers,omitempty"`
	Owner                     string            `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 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 ClientCallBuzz added in v0.0.9

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

type ClientCallBuzzCancel added in v0.0.10

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

type ClientCallBuzzCancelParams added in v0.0.10

type ClientCallBuzzCancelParams struct {
	Jid JID `json:"jid"`
}

type ClientCallBuzzParams added in v0.0.9

type ClientCallBuzzParams struct {
	Jid     JID   `json:"jid"`
	Members []JID `json:"members"`
}

type ClientCallLeave added in v0.0.9

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

type ClientCallLeaveParams added in v0.0.9

type ClientCallLeaveParams struct {
	Jid                 JID    `json:"jid"`
	Reason              string `json:"reason"`
	LeaveWithoutClosing bool   `json:"test_not_in_room,omitempty"`
}

type ClientCallMuteAll added in v0.0.9

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

type ClientCallMuteAllParams added in v0.0.9

type ClientCallMuteAllParams struct {
	Jid JID `json:"jid"`
}

type ClientCallOffer added in v0.0.9

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

type ClientCallOfferParams added in v0.0.9

type ClientCallOfferParams struct {
	Jid     JID    `json:"jid"`
	Muted   bool   `json:"muted"`
	Trickle bool   `json:"trickle"`
	Sdp     string `json:"sdp"`
}

type ClientCallReject added in v0.0.9

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

type ClientCallRejectParams added in v0.0.9

type ClientCallRejectParams struct {
	Jid    JID    `json:"jid"`
	Reason string `json:"reason"`
}

type ClientCallSound added in v0.0.9

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

type ClientCallSoundParams added in v0.0.9

type ClientCallSoundParams struct {
	Jid   JID  `json:"jid"`
	Muted bool `json:"muted"`
}

type ClientCallTrickle added in v0.0.9

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

type ClientCallTrickleParams added in v0.0.9

type ClientCallTrickleParams struct {
	Jid           JID    `json:"jid"`
	Candidate     string `json:"candidate"`
	SdpMid        string `json:"sdp_mid"`
	SdpMlineIndex int    `json:"sdp_mline_index"`
}

type ClientMessageUpdated added in v0.0.9

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

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 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"`
}

type Contact added in v0.0.7

type Contact struct {
	DisplayName     string     `json:"display_name"`
	ShortName       string     `json:"short_name,omitempty"`
	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"`
	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 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
	IsUnimportant() bool
}

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 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 GroupMembers added in v0.0.8

type GroupMembers struct {
	Members []GroupMembership `json:"members"`
}

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 {
	Sm      *SingleIcon `json:"sm,omitempty"`
	Lg      *SingleIcon `json:"lg,omitempty"`
	Stub    string      `json:"stub,omitempty"`
	Letters string      `json:"letters,omitempty"`
	Color   string      `json:"color,omitempty"`
}

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 {
	Pattern   string              `json:"pattern"`
	Url       string              `json:"url"`
	Text      string              `json:"text"`
	Preview   *MessageLinkPreview `json:"preview,omitempty"`
	Uploads   []Upload            `json:"uploads,omitempty"`
	NoPreview bool                `json:"nopreview,omitempty"`
	YoutubeId string              `json:"youtube_id,omitempty"`
}

type MessageLinkPreview added in v0.0.4

type MessageLinkPreview struct {
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
}
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      string `json:"sender"`
	Chat        string `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  string `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 ServerCallAnswerParams added in v0.0.9

type ServerCallAnswerParams struct {
	Jid        JID                         `json:"jid"`
	Candidates []serverCallAnswerCandidate `json:"candidates"`
	Onliners   []CallOnliner               `json:"onliners"`
	JSEP       JSEP                        `json:"jsep"`
	Uid        string                      `json:"uid"`
}

type ServerCallBuzz added in v0.0.9

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

func NewServerCallBuzz added in v0.0.9

func NewServerCallBuzz(chat JID, teamUid, displayName string, icons *IconData, uid string, timeout time.Duration) (r ServerCallBuzz)

type ServerCallBuzzParams added in v0.0.9

type ServerCallBuzzParams struct {
	Jid         JID       `json:"jid"`
	Team        string    `json:"team"`
	DisplayName string    `json:"display_name"`
	Icons       *IconData `json:"icons"`
	Uid         string    `json:"uid"`
	BuzzTimeout int       `json:"buzz_timeout"`
}

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 ServerCallBuzzcancelParams added in v0.0.9

type ServerCallBuzzcancelParams struct {
	Jid  JID    `json:"jid"`
	Team string `json:"team"`
	Uid  string `json:"uid"`
}

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 ServerCallCheckFingerprintParams added in v0.0.9

type ServerCallCheckFingerprintParams struct {
	Fingerprint string `json:"fingerprint"`
}

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 ServerCallLeaveParams added in v0.0.9

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

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 ServerCallMuteallParams added in v0.0.9

type ServerCallMuteallParams struct {
	Jid   JID    `json:"jid"`
	Muted bool   `json:"muted"`
	Error string `json:"reason"`
}

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 ServerCallRejectParams added in v0.0.9

type ServerCallRejectParams struct {
	Jid    JID    `json:"jid"`
	Reason string `json:"reason"`
	Uid    string `json:"uid"`
}

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 ServerCallRestartParams added in v0.0.9

type ServerCallRestartParams struct {
	Jid  JID    `json:"jid"`
	Team string `json:"team"`
	Uid  string `json:"uid"`
}

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 ServerCallSoundParams added in v0.0.9

type ServerCallSoundParams struct {
	Jid   JID  `json:"jid"`
	Muted bool `json:"muted"`
}

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 ServerCallStateParams added in v0.0.9

type ServerCallStateParams struct {
	Jid         JID           `json:"jid"`
	Onliners    []CallOnliner `json:"onliners"`
	Start       *string       `json:"start"`
	Finish      *string       `json:"finish"`
	Audiorecord bool          `json:"audiorecord"`
	Buzz        bool          `json:"buzz,omitempty"`
	Uid         string        `json:"uid"`
	Timestamp   int64         `json:"timestamp"`
}

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 ServerCallTalkingParams added in v0.0.9

type ServerCallTalkingParams struct {
	Jid     JID  `json:"jid"`
	Actor   JID  `json:"actor"`
	Talking bool `json:"talking"`
}

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 ServerChatComposingParams added in v0.0.9

type ServerChatComposingParams struct {
	Jid       JID  `json:"jid"`
	Actor     JID  `json:"actor"`
	Composing bool `json:"composing"`
	IsAudio   bool `json:"is_audio,omitempty"`
}

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 ServerChatDeletedParams added in v0.0.9

type ServerChatDeletedParams struct {
	Chats      []DeletedChat `json:"chats"`
	TeamUnread *TeamUnread   `json:"team_unread"`
	Badge      uint          `json:"badge"`
}

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 ServerChatDraftParams added in v0.0.9

type ServerChatDraftParams struct {
	Jid      *JID   `json:"jid"`
	Draft    string `json:"draft"`
	DraftNum int64  `json:"draft_num"`
}

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 ServerChatLastreadParams added in v0.0.9

type ServerChatLastreadParams struct {
	Chats      []ChatCounters `json:"chats"`
	TeamUnread *TeamUnread    `json:"team_unread"`
	Badge      uint           `json:"badge"`
}

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 ServerChatUpdatedParams added in v0.0.9

type ServerChatUpdatedParams struct {
	Chats      []Chat      `json:"chats"`
	TeamUnread *TeamUnread `json:"team_unread"`
	Badge      uint        `json:"badge"`
}

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 ServerConfirmParams added in v0.0.9

type ServerConfirmParams struct {
	ConfirmId string `json:"confirm_id"`
}

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 ServerContactUpdatedParams added in v0.0.9

type ServerContactUpdatedParams struct {
	Contacts []Contact `json:"contacts"`
}

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 ServerDebugParams added in v0.0.9

type ServerDebugParams struct {
	Text string `json:"text"`
}

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 ServerLoginParams added in v0.0.9

type ServerLoginParams struct {
	DeviceName string `json:"device_name"`
}

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 ServerMessageReceivedParams added in v0.0.9

type ServerMessageReceivedParams struct {
	Messages []ReceivedMessage `json:"messages"`
}

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 ServerMessageUpdatedParams added in v0.0.9

type ServerMessageUpdatedParams struct {
	Messages     []Message      `json:"messages"`
	Delayed      bool           `json:"delayed"`
	ChatCounters []ChatCounters `json:"chat_counters"` // TODO: omitempty
	TeamUnread   *TeamUnread    `json:"team_unread"`   // TODO: omitempty
	Badge        *uint          `json:"badge"`         // TODO: omitempty
}

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 ServerOnlineParams added in v0.0.9

type ServerOnlineParams struct {
	Contacts *[]OnlineContact `json:"contacts"`
	Calls    *[]OnlineCall    `json:"calls"`
}

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 ServerPanicParams added in v0.0.9

type ServerPanicParams struct {
	Code  string `json:"code"`
	Debug string `json:"debug,omitempty"`
}

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 ServerProcessingParams added in v0.0.9

type ServerProcessingParams struct {
	Action   string `json:"action"`
	Message  string `json:"message"`
	HasError bool   `json:"has_error"`
	Num      int    `json:"num"`
	Total    int    `json:"total"`
}

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 ServerRemindDeletedParams added in v0.0.9

type ServerRemindDeletedParams struct {
	Remind []DeletedRemind `json:"reminds"`
}

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 ServerRemindFiredParams added in v0.0.9

type ServerRemindFiredParams struct {
	Reminds []Remind `json:"reminds"`
}

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 ServerRemindUpdatedParams added in v0.0.9

type ServerRemindUpdatedParams struct {
	Reminds []Remind `json:"reminds"`
}

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 ServerSectionDeletedParams added in v0.0.9

type ServerSectionDeletedParams struct {
	ChatType ChatType         `json:"chat_type"`
	Gentime  int64            `json:"gentime"`
	Sections []DeletedSection `json:"sections"`
}

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 ServerSectionUpdatedParams added in v0.0.9

type ServerSectionUpdatedParams struct {
	ChatType ChatType  `json:"chat_type"`
	Gentime  int64     `json:"gentime"`
	Sections []Section `json:"sections"`
}

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 ServerTagDeletedParams added in v0.0.9

type ServerTagDeletedParams struct {
	Tags []DeletedTag `json:"tags"`
}

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 ServerTagUpdatedParams added in v0.0.9

type ServerTagUpdatedParams struct {
	Tags []Tag `json:"tags"`
}

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 ServerTeamCountersParams added in v0.0.9

type ServerTeamCountersParams struct {
	Teams []TeamCounter `json:"teams"`
	Badge uint          `json:"badge"`
}

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 ServerTeamDeletedParams added in v0.0.9

type ServerTeamDeletedParams struct {
	Teams []DeletedTeam `json:"teams"`
}

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 ServerTeamUpdatedParams added in v0.0.9

type ServerTeamUpdatedParams struct {
	Teams []Team `json:"teams"`
}

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 ServerTimeParams added in v0.0.9

type ServerTimeParams struct {
	Time string `json:"time"`
}

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 ServerWarningParams added in v0.0.9

type ServerWarningParams struct {
	Message string      `json:"message"`
	Orig    interface{} `json:"orig"`
}

type SingleIcon added in v0.0.7

type SingleIcon struct {
	Url    string `json:"url,omitempty"`
	Width  int    `json:"width,omitempty"`
	Height int    `json:"height"`
}

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"`
	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"`
}

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 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

Jump to

Keyboard shortcuts

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