summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-17 14:01:01 -0800
committerCorey Hulen <corey@hulen.com>2015-07-17 14:01:01 -0800
commitb306ec84378b36372b5465c09233094314789bf2 (patch)
tree1995d12ac34a4c6ba459884c84cb28b62d62b296 /store/sql_channel_store.go
parent66c22d342fa42068382c9e80427ea953676357db (diff)
parent1dba330146a10718a2fc9eac0ae7d6e1d6bc0d79 (diff)
downloadchat-b306ec84378b36372b5465c09233094314789bf2.tar.gz
chat-b306ec84378b36372b5465c09233094314789bf2.tar.bz2
chat-b306ec84378b36372b5465c09233094314789bf2.zip
Merge pull request #177 from hmhealey/mm825
MM-825 Replace FullName field with separate FirstName and LastName fields and repurpose the existing FullName as Nickname
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index d61fbcdd0..6820b2326 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -81,11 +81,11 @@ func (s SqlChannelStore) Save(channel *model.Channel) StoreChannel {
if strings.Contains(err.Error(), "Duplicate entry") && strings.Contains(err.Error(), "for key 'Name'") {
dupChannel := model.Channel{}
s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId=? AND Name=? AND DeleteAt > 0", channel.TeamId, channel.Name)
- if (dupChannel.DeleteAt > 0) {
+ if dupChannel.DeleteAt > 0 {
result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name was previously created", "id="+channel.Id+", "+err.Error())
} else {
result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name already exists", "id="+channel.Id+", "+err.Error())
- }
+ }
} else {
result.Err = model.NewAppError("SqlChannelStore.Save", "We couldn't save the channel", "id="+channel.Id+", "+err.Error())
}
@@ -119,7 +119,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel {
if strings.Contains(err.Error(), "Duplicate entry") && strings.Contains(err.Error(), "for key 'Name'") {
dupChannel := model.Channel{}
s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId=? AND Name=? AND DeleteAt > 0", channel.TeamId, channel.Name)
- if (dupChannel.DeleteAt > 0) {
+ if dupChannel.DeleteAt > 0 {
result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name was previously created", "id="+channel.Id+", "+err.Error())
} else {
result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name already exists", "id="+channel.Id+", "+err.Error())
@@ -358,7 +358,7 @@ func (s SqlChannelStore) GetExtraMembers(channelId string, limit int) StoreChann
result := StoreResult{}
var members []model.ExtraMember
- _, err := s.GetReplica().Select(&members, "SELECT Id, FullName, Email, ChannelMembers.Roles, Username FROM ChannelMembers, Users WHERE ChannelMembers.UserId = Users.Id AND ChannelId = ? LIMIT ?", channelId, limit)
+ _, err := s.GetReplica().Select(&members, "SELECT Id, Nickname, Email, ChannelMembers.Roles, Username FROM ChannelMembers, Users WHERE ChannelMembers.UserId = Users.Id AND ChannelId = ? LIMIT ?", channelId, limit)
if err != nil {
result.Err = model.NewAppError("SqlChannelStore.GetExtraMembers", "We couldn't get the extra info for channel members", "channel_id="+channelId+", "+err.Error())
} else {