MM-32133 shared channel username collisions (#17347)

Support for handling username collisions between remote clusters. Users belonging to remote clusters have their username changed to include the remote name e.g. wiggin becomes wiggin:mattermost.

@mentions are also modified so the munged username is replaced with the original username when the post is sync'd with the remote the user belongs to.

When adding remote users:
- append the remote name to the username with colon separator
- append the remote name to the email address with colon separator
- store the original username and email address in user props
- when resolving @mentions replace with the stored original username
Этот коммит содержится в:
Doug Lauder
2021-04-13 10:40:12 -04:00
коммит произвёл GitHub
родитель 869da7a78b
Коммит f69cb38249
28 изменённых файлов: 544 добавлений и 147 удалений

Просмотреть файл

@@ -22,9 +22,10 @@ func newSqlRemoteClusterStore(sqlStore *SqlStore) store.RemoteClusterStore {
s := &sqlRemoteClusterStore{sqlStore}
for _, db := range sqlStore.GetAllConns() {
table := db.AddTableWithName(model.RemoteCluster{}, "RemoteClusters").SetKeys(false, "RemoteId")
table := db.AddTableWithName(model.RemoteCluster{}, "RemoteClusters").SetKeys(false, "RemoteId", "Name")
table.ColMap("RemoteId").SetMaxSize(26)
table.ColMap("RemoteTeamId").SetMaxSize(26)
table.ColMap("Name").SetMaxSize(64)
table.ColMap("DisplayName").SetMaxSize(64)
table.ColMap("SiteURL").SetMaxSize(512)
table.ColMap("Token").SetMaxSize(26)