5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 18:40:25 +00:00

Add GetStatuses()

This commit is contained in:
Wim 2017-01-17 22:47:59 +01:00
parent 93114b7682
commit 6df6c5d615

View File

@ -582,6 +582,27 @@ func (m *MMClient) GetStatus(userId string) string {
return "offline"
}
func (m *MMClient) GetStatuses() map[string]string {
var ok bool
statuses := make(map[string]string)
res, err := m.Client.GetStatuses()
if err != nil {
return statuses
}
if statuses, ok = res.Data.(map[string]string); ok {
for userId, status := range statuses {
statuses[userId] = "offline"
if status == model.STATUS_AWAY {
statuses[userId] = "away"
}
if status == model.STATUS_ONLINE {
statuses[userId] = "online"
}
}
}
return statuses
}
func (m *MMClient) GetTeamId() string {
return m.Team.Id
}