Documentation ¶
Index ¶
- Constants
- func IsValidUid(s string) bool
- type ChatType
- type Features
- type HasJid
- type ICEServer
- type JID
- func (jid JID) ChatType() ChatType
- func (jid JID) Empty() bool
- func (jid JID) Equal(other JID) bool
- func (jid JID) IsDirect() bool
- func (jid JID) IsGroup() bool
- func (jid JID) IsSection() bool
- func (jid JID) IsTask() bool
- func (jid JID) JID() *JID
- func (jid JID) MarshalJSON() ([]byte, error)
- func (jid JID) String() string
- func (jid JID) Uid() string
- func (jid *JID) UnmarshalJSON(data []byte) error
- func (jid JID) Valid() bool
- func (jid JID) Value() string
- type JIDs
- type Mediasubtype
- type Mediatype
- type Message
- type MessageContent
- type MessageLink
- type MessageLinkPreview
- type MessageLinks
- type MessageReaction
- type MessageReactionDetail
- type PdfVersion
- type Terms
- type Upload
- type UploadPreview
Constants ¶
View Source
const ( DirectChatType = ChatType("direct") GroupChatType = ChatType("group") TaskChatType = ChatType("task") )
View Source
const ( ContactPrefix = "d-" GroupPrefix = "g-" TaskPrefix = "t-" ContactSectionPrefix = "sd-" GroupSectionPrefix = "sg-" TaskSectionPrefix = "st-" )
Variables ¶
This section is empty.
Functions ¶
func IsValidUid ¶ added in v0.0.4
Types ¶
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 JID ¶ added in v0.0.4
type JID struct {
// contains filtered or unexported fields
}
func (JID) MarshalJSON ¶ added in v0.0.4
func (*JID) UnmarshalJSON ¶ added in v0.0.4
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 ¶ added in v0.0.4
type MessageLinkPreview ¶ added in v0.0.4
type MessageLinks ¶ added in v0.0.4
type MessageLinks []MessageLink
func (MessageLinks) Sort ¶ added in v0.0.4
func (links MessageLinks) Sort()
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 PdfVersion ¶ added in v0.0.4
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 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"` }
Click to show internal directories.
Click to hide internal directories.