Teams sometimes translates an at-mention for a user like Miguel De La Cruz into four discrete mentions. Fortunately, these are combined in a way that's unique relative to adjacent mentions, even for the same user, so we can detect and patch these deterministically.
There was code that attempted to handle this, but it seemed to only deal with two mentions in a row. For reference, the payload from Teams looks something like this:
Summary
Teams sometimes translates an at-mention for a user like
Miguel De La Cruz
into four discrete mentions. Fortunately, these are combined in a way that's unique relative to adjacent mentions, even for the same user, so we can detect and patch these deterministically.There was code that attempted to handle this, but it seemed to only deal with two mentions in a row. For reference, the payload from Teams looks something like this:
And ended up looking something like this:
While we're in here, remove a redundant space after mentions.
Ticket Link
Fixes: https://mattermost.atlassian.net/browse/MM-58484