Remove Channel/Username normalization (except TrimSpace)

This commit is contained in:
2023-05-28 13:14:05 +02:00
parent efaad3f97c
commit 397bfe78aa
6 changed files with 94 additions and 109 deletions

View File

@@ -328,27 +328,15 @@ func (app *Application) GetOrCreateChannel(ctx *AppContext, userid models.UserID
}
func (app *Application) NormalizeChannelDisplayName(v string) string {
v = strings.TrimSpace(v)
v = rexWhitespaceStart.RemoveAll(v)
v = rexWhitespaceEnd.RemoveAll(v)
return v
return strings.TrimSpace(v)
}
func (app *Application) NormalizeChannelInternalName(v string) string {
v = strings.TrimSpace(v)
v = strings.ToLower(v)
v = rexWhitespaceStart.RemoveAll(v)
v = rexWhitespaceEnd.RemoveAll(v)
return v
return strings.TrimSpace(v)
}
func (app *Application) NormalizeUsername(v string) string {
v = strings.TrimSpace(v)
v = rexNormalizeUsername.RemoveAll(v)
return v
return strings.TrimSpace(v)
}
func (app *Application) DeliverMessage(ctx context.Context, client models.Client, msg models.Message, compatTitleOverride *string) (*string, error) {