summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-28 13:16:03 -0400
committerChristopher Speller <crspeller@gmail.com>2017-04-28 13:16:03 -0400
commit96906482cecb0df21c8e1a40a2ba00c13c0182a7 (patch)
tree3bb35ca9fe2a3beb212b5350116f7bb488d7a119 /app/channel.go
parent302ec17beed9128101ef61d69b45d3ee29e16f1e (diff)
downloadchat-96906482cecb0df21c8e1a40a2ba00c13c0182a7.tar.gz
chat-96906482cecb0df21c8e1a40a2ba00c13c0182a7.tar.bz2
chat-96906482cecb0df21c8e1a40a2ba00c13c0182a7.zip
PLT-6214 Move channel store and actions over to redux (#6235)
* Move channel store and actions over to redux * Fix style errors * Fix unit test * Various fixes * More fixes * Revert config changes
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/channel.go b/app/channel.go
index 17fa02ad3..0d9cb5a94 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -490,7 +490,11 @@ func AddChannelMember(userId string, channel *model.Channel, userRequestorId str
return nil, err
}
- go PostAddToChannelMessage(userRequestor, user, channel)
+ if userId == userRequestorId {
+ postJoinChannelMessage(user, channel)
+ } else {
+ go PostAddToChannelMessage(userRequestor, user, channel)
+ }
UpdateChannelLastViewedAt([]string{channel.Id}, userRequestor.Id)
@@ -961,7 +965,11 @@ func RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel
return err
}
- go PostRemoveFromChannelMessage(removerUserId, user, channel)
+ if userIdToRemove == removerUserId {
+ postLeaveChannelMessage(user, channel)
+ } else {
+ go PostRemoveFromChannelMessage(removerUserId, user, channel)
+ }
return nil
}