Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit a83d44781745394efaaa23d89d3c9fe95888002c Author: Wim <wim@42.be> Date: Tue Jan 17 22:47:59 2017 +0000 Add GetStatuses() diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index b860ec8..93fb7ca 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -5826 +58227 @@ 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  }