summaryrefslogtreecommitdiffstats
path: root/api/channel.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/channel.go')
-rw-r--r--api/channel.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/api/channel.go b/api/channel.go
index 63acaa8d1..896e22793 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -121,11 +121,7 @@ func CreateDirectChannel(c *Context, otherUserId string) (*model.Channel, *model
channel := new(model.Channel)
channel.DisplayName = ""
- if otherUserId > c.Session.UserId {
- channel.Name = c.Session.UserId + "__" + otherUserId
- } else {
- channel.Name = otherUserId + "__" + c.Session.UserId
- }
+ channel.Name = model.GetDMNameFromIds(otherUserId, c.Session.UserId)
channel.TeamId = c.Session.TeamId
channel.Description = ""