matrix

package
v0.0.0-...-d19560e Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: GPL-3.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoLogin

func DoLogin(username, password, homeserverURL, userID, accessToken string, results chan<- *gomatrix.Client, wg *sync.WaitGroup)

DoLogin generates the needed Client

func GetClient

func GetClient(homeserverURL, userID, accessToken string) (client *gomatrix.Client, err error)

GetClient returns a Client

func GetOwnUserAvatar

func GetOwnUserAvatar(cli *gomatrix.Client) (avatar *gui.QPixmap, err error)

GetOwnUserAvatar returns a *gui.QPixmap of an UserAvatar

func GetUserAvatar

func GetUserAvatar(cli *gomatrix.Client, mxid string, size int) (avatarResp *gui.QPixmap, err error)

GetUserAvatar returns a *gui.QPixmap of an UserAvatar

func LoginUser

func LoginUser(username, password string) (*gomatrix.Client, error)

LoginUser Creates a Session for the User

Types

type HTMLMessage

type HTMLMessage struct {
	MsgType       string `json:"msgtype,omitempty"`
	Body          string `json:"body,omitempty"`
	FormattedBody string `json:"formatted_body,omitempty"`
	Format        string `json:"format,omitempty"`
}

HTMLMessage is the contents of a Matrix formated message event.

type JoinedRooms

type JoinedRooms struct {
	JoinedRooms []string `json:"joined_rooms,omitempty"`
}

JoinedRooms is the json response when getting the joined rooms list

type Room

type Room struct {
	RoomID        string
	RoomName      string
	RoomAvatarURL string
	RoomTopic     string
	// contains filtered or unexported fields
}

Room saves the information of a Room

func NewRoom

func NewRoom(roomID string, cli *gomatrix.Client) (room *Room)

NewRoom Inits a new Room struct

func (*Room) GetRoomAvatar

func (r *Room) GetRoomAvatar() (avatarResp *gui.QPixmap, err error)

GetRoomAvatar generates the Avatar Image for a Room

func (*Room) GetRoomName

func (r *Room) GetRoomName() (name string)

GetRoomName gives you the name of the current Room

func (*Room) GetRoomTopic

func (r *Room) GetRoomTopic() (topic string)

GetRoomTopic returns the Topic of the Room and crawls it if needed

type RoomAliases

type RoomAliases struct {
	Age     int `json:"age,omitempty"`
	Content struct {
		Aliases []string `json:"aliases,omitempty"`
	} `json:"content,omitempty"`
	EventID        string `json:"event_id,omitempty"`
	OriginServerTs int64  `json:"origin_server_ts,omitempty"`
	RoomID         string `json:"room_id,omitempty"`
	Sender         string `json:"sender,omitempty"`
	StateKey       string `json:"state_key,omitempty"`
	Type           string `json:"type,omitempty"`
}

RoomAliases is the json response when getting the room aliases

type RoomAvatar

type RoomAvatar struct {
	Age     int `json:"age,omitempty"`
	Content struct {
		Info struct {
			H        int    `json:"h,omitempty"`
			Mimetype string `json:"mimetype,omitempty"`
			Size     int    `json:"size,omitempty"`
			W        int    `json:"w,omitempty"`
		} `json:"info,omitempty"`
		URL string `json:"url,omitempty"`
	} `json:"content,omitempty"`
	EventID        string `json:"event_id,omitempty"`
	OriginServerTs int64  `json:"origin_server_ts,omitempty"`
	RoomID         string `json:"room_id,omitempty"`
	Sender         string `json:"sender,omitempty"`
	StateKey       string `json:"state_key,omitempty"`
	Type           string `json:"type,omitempty"`
}

RoomAvatar is the json response when getting the room avatar list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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