42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Addition and removal of user to/from team from system #442

Closed hloeung closed 3 years ago

hloeung commented 3 years ago

Rather than this:

|14:07 <myuser> myuser removed from the team.

We get this:

|14:07 <system> myuser removed from the team.

This better matches with what's shown via the Mattermost web UI:

System 00:23
@myuser was removed from the team.

As well as when users are added or removed from channels per https://github.com/42wim/matterircd/blob/master/mm-go-irckit/userbridge.go#L187 :

|00:56 <system> added myuser to the channel by hloeung
42wim commented 3 years ago

Good idea, but on matterbridge where I also used system in one of the bridges I got people complaining that system could be a real nick.. I'm not sure if mattermost allows this nick though.

hloeung commented 3 years ago

The "system" user is reserved per https://github.com/mattermost/mattermost-server/blob/master/model/user.go#L875 :

var restrictedUsernames = map[string]struct{}{
    "all":       {},
    "channel":   {},
    "matterbot": {},
    "system":    {},
}

We're also already using it for channel joins in https://github.com/42wim/matterircd/blob/master/bridge/mattermost/mattermost.go#L1059