Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# matterclient
[![Go](https://img.shields.io/badge/Go-1.21%2B-blue?style=flat-square&logo=go)](https://go.dev/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square)](LICENSE)

**Mattermost client library in Golang**

A lightweight, robust Go library for interacting with [Mattermost](https://mattermost.com/) servers.

It supports authentication (password, token, MFA), team/channel discovery, real-time messaging over WebSocket and more.

It is used internally by Matterbridge (and was originally extracted from it).

## Related projects

- [Matterbridge](https://github.com/matterbridge-org/matterbridge/tree/master) - the universal chat bridge

## Acknowledgments

Original author / maintainer: This library was originally developed by **Wim** (@42wim) as part of the Matterbridge project.
This repository is a fork of the original [matterbridge/matterclient](https://github.com/matterbridge/matterclient) for continued maintenance and updates.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/matterbridge/matterclient
module github.com/matterbridge-org/matterclient

go 1.21

Expand Down
16 changes: 16 additions & 0 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ func (m *Client) GetNickName(userID string) string {
return ""
}

func (m *Client) GetFirstName(userID string) string {
if user := m.GetUser(userID); user != nil {
return user.FirstName
}

return ""
}

func (m *Client) GetLastName(userID string) string {
if user := m.GetUser(userID); user != nil {
return user.LastName
}

return ""
}

func (m *Client) GetStatus(userID string) string {
res, _, err := m.Client.GetUserStatus(context.TODO(), userID, "")
if err != nil {
Expand Down