Version: v0.3.0 Latest Latest

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 1




This section is empty.


View Source
var (
	// ErrUserIsNil is returned when a function is called with an nil user.
	ErrUserIsNil = errors.New("user is nil")

	// ErrCannotDownloadFile is returned when a function cannot download the requested file
	ErrCannotDownloadFile = errors.New("cannot download file")


This section is empty.


type Capabilities

type Capabilities struct {
	AttachmentsFolder      string `ocscapability:"config => attachments => folder"`
	Audio                  bool   `ocscapability:"audio"`
	Video                  bool   `ocscapability:"video"`
	Chat                   bool   `ocscapability:"chat"`
	GuestSignaling         bool   `ocscapability:"guest-signaling"`
	EmptyGroupRoom         bool   `ocscapability:"empty-group-room"`
	GuestDisplayNames      bool   `ocscapability:"guest-display-names"`
	MultiRoomUsers         bool   `ocscapability:"multi-room-users"`
	ChatV2                 bool   `ocscapability:"chat-v2"`
	Favorites              bool   `ocscapability:"favorites"`
	LastRoomActivity       bool   `ocscapability:"last-room-activity"`
	NoPing                 bool   `ocscapability:"no-ping"`
	SystemMessages         bool   `ocscapability:"system-messages"`
	MentionFlag            bool   `ocscapability:"mention-flag"`
	InCallFlags            bool   `ocscapability:"in-call-flags"`
	InviteByMail           bool   `ocscapability:"invite-by-mail"`
	NotificationLevels     bool   `ocscapability:"notification-levels"`
	InviteGroupsAndMails   bool   `ocscapability:"invite-groups-and-mails"`
	LockedOneToOneRooms    bool   `ocscapability:"locked-one-to-one-rooms"`
	ReadOnlyRooms          bool   `ocscapability:"read-only-rooms"`
	ChatReadMarker         bool   `ocscapability:"chat-read-marker"`
	WebinaryLobby          bool   `ocscapability:"webinary-lobby"`
	StartCallFlag          bool   `ocscapability:"start-call-flag"`
	ChatReplies            bool   `ocscapability:"chat-replies"`
	CirclesSupport         bool   `ocscapability:"circles-support"`
	AttachmentsAllowed     bool   `ocscapability:"config => attachments => allowed"`
	ConversationsCanCreate bool   `ocscapability:"config => conversations => can-create"`
	ForceMute              bool   `ocscapability:"force-mute"`
	ConversationV2         bool   `ocscapability:"conversation-v2"`
	ChatReferenceID        bool   `ocscapability:"chat-reference-id"`
	ConversationV3         bool   `ocscapability:"conversation-v3"`
	ConversationV4         bool   `ocscapability:"conversation-v4"`
	SIPSupport             bool   `ocscapability:"sip-support"`
	ChatReadStatus         bool   `ocscapability:"chat-read-status"`
	ListableRooms          bool   `ocscapability:"listable-rooms"`
	PhonebookSearch        bool   `ocscapability:"phonebook-search"`
	RaiseHand              bool   `ocscapability:"raise-hand"`
	RoomDescription        bool   `ocscapability:"room-description"`
	DeleteMessages         bool   `ocscapability:"delete-messages"`
	RichObjectSharing      bool   `ocscapability:"rich-object-sharing"`
	ConversationCallFlags  bool   `ocscapability:"conversation-call-flags"`
	GeoLocationSharing     bool   `ocscapability:"geo-location-sharing"`
	ReadPrivacyConfig      bool   `ocscapability:"config => chat => read-privacy"`
	SignalingV3            bool   `ocscapability:"signaling-v3"`
	TempUserAvatarAPI      bool   `ocscapability:"temp-user-avatar-api"`
	MaxGifSizeConfig       int    `ocscapability:"config => previews => max-gif-size"`
	ChatMaxLength          int    `ocscapability:"config => chat => max-length"`

Capabilities describes the capabilities that the Nextcloud Talk instance is capable of. Visit for more info.

type RoomInfo added in v0.1.2

type RoomInfo struct {
	Token                 string                   `json:"token"`
	Name                  string                   `json:"name"`
	DisplayName           string                   `json:"displayName"`
	SessionID             string                   `json:"sessionId"`
	ObjectType            string                   `json:"objectType"`
	ObjectID              string                   `json:"objectId"`
	Type                  int                      `json:"type"`
	ParticipantType       int                      `json:"participantType"`
	ParticipantFlags      int                      `json:"participantFlags"`
	ReadOnly              int                      `json:"readOnly"`
	LastPing              int                      `json:"lastPing"`
	LastActivity          int                      `json:"lastActivity"`
	NotificationLevel     int                      `json:"notificationLevel"`
	LobbyState            int                      `json:"lobbyState"`
	LobbyTimer            int                      `json:"lobbyTimer"`
	UnreadMessages        int                      `json:"unreadMessages"`
	LastReadMessage       int                      `json:"lastReadMessage"`
	HasPassword           bool                     `json:"hasPassword"`
	HasCall               bool                     `json:"hasCall"`
	CanStartCall          bool                     `json:"canStartCall"`
	CanDeleteConversation bool                     `json:"canDeleteConversation"`
	CanLeaveConversation  bool                     `json:"canLeaveConversation"`
	IsFavorite            bool                     `json:"isFavorite"`
	UnreadMention         bool                     `json:"unreadMention"`
	LastMessage           *ocs.TalkRoomMessageData `json:"lastMessage"`

RoomInfo contains information about a room

type TalkUser

type TalkUser struct {
	User         string
	Pass         string
	NextcloudURL string
	Config       *TalkUserConfig
	// contains filtered or unexported fields

TalkUser represents a user of Nextcloud Talk

func NewUser added in v0.1.0

func NewUser(url string, username string, password string, config *TalkUserConfig) (*TalkUser, error)

NewUser returns a TalkUser instance The url should be the full URL of the Nextcloud instance (e.g.

func (*TalkUser) Capabilities

func (t *TalkUser) Capabilities() (*Capabilities, error)

Capabilities returns an instance of Capabilities that describes what the Nextcloud Talk instance supports

func (*TalkUser) DownloadFile added in v0.1.0

func (t *TalkUser) DownloadFile(path string) (data *[]byte, err error)

DownloadFile downloads the file at the given path

Meant to be used with rich object string's path.

func (*TalkUser) GetRooms added in v0.1.2

func (t *TalkUser) GetRooms() (*[]RoomInfo, error)

GetRooms returns a list of all rooms the user is in

func (*TalkUser) RequestClient

func (t *TalkUser) RequestClient(client request.Client) *request.Client

RequestClient returns a monaco-io that is preconfigured to make OCS API calls

type TalkUserConfig added in v0.1.0

type TalkUserConfig struct {
	TLSConfig *tls.Config

TalkUserConfig is configuration options for TalkUsers

Source Files

Jump to

Keyboard shortcuts

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