From c7bdce8a6641ed8d361a43b6004a351535c78423 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 4 Apr 2017 11:54:52 -0400 Subject: PLT-5900 Removed automatic configuration of SiteURL (#5952) * Revert "PLT-5765 Passed SiteURL to SendNotifications (#5705)" This reverts commit a8e68bd8905972ae59de90fa33d5b3e3c274dc47. * Removed automatic configuration of SiteURL * Reverted unintentional config changes * Updated help text * Added link to docs in Site URL warning * Fixed merge conflict --- app/channel.go | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'app/channel.go') diff --git a/app/channel.go b/app/channel.go index 61b139e5b..c1e0afce9 100644 --- a/app/channel.go +++ b/app/channel.go @@ -32,7 +32,7 @@ func CreateDefaultChannels(teamId string) ([]*model.Channel, *model.AppError) { return channels, nil } -func JoinDefaultChannels(teamId string, user *model.User, channelRole string, siteURL string) *model.AppError { +func JoinDefaultChannels(teamId string, user *model.User, channelRole string) *model.AppError { var err *model.AppError = nil if result := <-Srv.Store.Channel().GetByName(teamId, "town-square", true); result.Err != nil { @@ -47,7 +47,7 @@ func JoinDefaultChannels(teamId string, user *model.User, channelRole string, si err = cmResult.Err } - if err := postJoinChannelMessage(user, townSquare, siteURL); err != nil { + if err := postJoinChannelMessage(user, townSquare); err != nil { l4g.Error(utils.T("api.channel.post_user_add_remove_message_and_forget.error"), err) } @@ -66,7 +66,7 @@ func JoinDefaultChannels(teamId string, user *model.User, channelRole string, si err = cmResult.Err } - if err := postJoinChannelMessage(user, offTopic, siteURL); err != nil { + if err := postJoinChannelMessage(user, offTopic); err != nil { l4g.Error(utils.T("api.channel.post_user_add_remove_message_and_forget.error"), err) } @@ -315,7 +315,7 @@ func UpdateChannelMemberNotifyProps(data map[string]string, channelId string, us } } -func DeleteChannel(channel *model.Channel, userId string, siteURL string) *model.AppError { +func DeleteChannel(channel *model.Channel, userId string) *model.AppError { uc := Srv.Store.User().Get(userId) ihc := Srv.Store.Webhook().GetIncomingByChannel(channel.Id) ohc := Srv.Store.Webhook().GetOutgoingByChannel(channel.Id, -1, -1) @@ -355,7 +355,7 @@ func DeleteChannel(channel *model.Channel, userId string, siteURL string) *model }, } - if _, err := CreatePost(post, channel.TeamId, false, siteURL); err != nil { + if _, err := CreatePost(post, channel.TeamId, false); err != nil { l4g.Error(utils.T("api.channel.delete_channel.failed_post.error"), err) } @@ -451,7 +451,7 @@ func AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelM return newMember, nil } -func AddChannelMember(userId string, channel *model.Channel, userRequestorId, siteURL string) (*model.ChannelMember, *model.AppError) { +func AddChannelMember(userId string, channel *model.Channel, userRequestorId string) (*model.ChannelMember, *model.AppError) { var user *model.User var err *model.AppError @@ -469,7 +469,7 @@ func AddChannelMember(userId string, channel *model.Channel, userRequestorId, si return nil, err } - go PostAddToChannelMessage(userRequestor, user, channel, siteURL) + go PostAddToChannelMessage(userRequestor, user, channel) UpdateChannelLastViewedAt([]string{channel.Id}, userRequestor.Id) @@ -512,7 +512,7 @@ func AddDirectChannels(teamId string, user *model.User) *model.AppError { return nil } -func PostUpdateChannelHeaderMessage(userId string, channelId string, teamId string, oldChannelHeader, newChannelHeader string, siteURL string) *model.AppError { +func PostUpdateChannelHeaderMessage(userId string, channelId string, teamId string, oldChannelHeader, newChannelHeader string) *model.AppError { uc := Srv.Store.User().Get(userId) if uresult := <-uc; uresult.Err != nil { @@ -541,7 +541,7 @@ func PostUpdateChannelHeaderMessage(userId string, channelId string, teamId stri }, } - if _, err := CreatePost(post, teamId, false, siteURL); err != nil { + if _, err := CreatePost(post, teamId, false); err != nil { return model.NewLocAppError("", "api.channel.post_update_channel_header_message_and_forget.post.error", nil, err.Error()) } } @@ -549,7 +549,7 @@ func PostUpdateChannelHeaderMessage(userId string, channelId string, teamId stri return nil } -func PostUpdateChannelPurposeMessage(userId string, channelId string, teamId string, oldChannelPurpose string, newChannelPurpose string, siteURL string) *model.AppError { +func PostUpdateChannelPurposeMessage(userId string, channelId string, teamId string, oldChannelPurpose string, newChannelPurpose string) *model.AppError { uc := Srv.Store.User().Get(userId) if uresult := <-uc; uresult.Err != nil { @@ -577,7 +577,7 @@ func PostUpdateChannelPurposeMessage(userId string, channelId string, teamId str "new_purpose": newChannelPurpose, }, } - if _, err := CreatePost(post, teamId, false, siteURL); err != nil { + if _, err := CreatePost(post, teamId, false); err != nil { return model.NewLocAppError("", "app.channel.post_update_channel_purpose_message.post.error", nil, err.Error()) } } @@ -585,7 +585,7 @@ func PostUpdateChannelPurposeMessage(userId string, channelId string, teamId str return nil } -func PostUpdateChannelDisplayNameMessage(userId string, channelId string, teamId string, oldChannelDisplayName, newChannelDisplayName string, siteURL string) *model.AppError { +func PostUpdateChannelDisplayNameMessage(userId string, channelId string, teamId string, oldChannelDisplayName, newChannelDisplayName string) *model.AppError { uc := Srv.Store.User().Get(userId) if uresult := <-uc; uresult.Err != nil { @@ -607,7 +607,7 @@ func PostUpdateChannelDisplayNameMessage(userId string, channelId string, teamId }, } - if _, err := CreatePost(post, teamId, false, siteURL); err != nil { + if _, err := CreatePost(post, teamId, false); err != nil { return model.NewLocAppError("PostUpdateChannelDisplayNameMessage", "api.channel.post_update_channel_displayname_message_and_forget.create_post.error", nil, err.Error()) } } @@ -754,7 +754,7 @@ func GetChannelUnread(channelId, userId string) (*model.ChannelUnread, *model.Ap return channelUnread, nil } -func JoinChannel(channel *model.Channel, userId string, siteURL string) *model.AppError { +func JoinChannel(channel *model.Channel, userId string) *model.AppError { if channel.DeleteAt > 0 { return model.NewLocAppError("JoinChannel", "api.channel.join_channel.already_deleted.app_error", nil, "") } @@ -775,7 +775,7 @@ func JoinChannel(channel *model.Channel, userId string, siteURL string) *model.A return err } - if err := postJoinChannelMessage(user, channel, siteURL); err != nil { + if err := postJoinChannelMessage(user, channel); err != nil { return err } } else { @@ -786,7 +786,7 @@ func JoinChannel(channel *model.Channel, userId string, siteURL string) *model.A return nil } -func postJoinChannelMessage(user *model.User, channel *model.Channel, siteURL string) *model.AppError { +func postJoinChannelMessage(user *model.User, channel *model.Channel) *model.AppError { post := &model.Post{ ChannelId: channel.Id, Message: fmt.Sprintf(utils.T("api.channel.join_channel.post_and_forget"), user.Username), @@ -797,14 +797,14 @@ func postJoinChannelMessage(user *model.User, channel *model.Channel, siteURL st }, } - if _, err := CreatePost(post, channel.TeamId, false, siteURL); err != nil { + if _, err := CreatePost(post, channel.TeamId, false); err != nil { return model.NewLocAppError("postJoinChannelMessage", "api.channel.post_user_add_remove_message_and_forget.error", nil, err.Error()) } return nil } -func LeaveChannel(channelId string, userId string, siteURL string) *model.AppError { +func LeaveChannel(channelId string, userId string) *model.AppError { sc := Srv.Store.Channel().Get(channelId, true) uc := Srv.Store.User().Get(userId) ccm := Srv.Store.Channel().GetMemberCount(channelId, false) @@ -836,13 +836,13 @@ func LeaveChannel(channelId string, userId string, siteURL string) *model.AppErr return err } - go postLeaveChannelMessage(user, channel, siteURL) + go postLeaveChannelMessage(user, channel) } return nil } -func postLeaveChannelMessage(user *model.User, channel *model.Channel, siteURL string) *model.AppError { +func postLeaveChannelMessage(user *model.User, channel *model.Channel) *model.AppError { post := &model.Post{ ChannelId: channel.Id, Message: fmt.Sprintf(utils.T("api.channel.leave.left"), user.Username), @@ -853,14 +853,14 @@ func postLeaveChannelMessage(user *model.User, channel *model.Channel, siteURL s }, } - if _, err := CreatePost(post, channel.TeamId, false, siteURL); err != nil { + if _, err := CreatePost(post, channel.TeamId, false); err != nil { return model.NewLocAppError("postLeaveChannelMessage", "api.channel.post_user_add_remove_message_and_forget.error", nil, err.Error()) } return nil } -func PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, siteURL string) *model.AppError { +func PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel) *model.AppError { post := &model.Post{ ChannelId: channel.Id, Message: fmt.Sprintf(utils.T("api.channel.add_member.added"), addedUser.Username, user.Username), @@ -872,14 +872,14 @@ func PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *m }, } - if _, err := CreatePost(post, channel.TeamId, false, siteURL); err != nil { + if _, err := CreatePost(post, channel.TeamId, false); err != nil { return model.NewLocAppError("postAddToChannelMessage", "api.channel.post_user_add_remove_message_and_forget.error", nil, err.Error()) } return nil } -func PostRemoveFromChannelMessage(removerUserId string, removedUser *model.User, channel *model.Channel, siteURL string) *model.AppError { +func PostRemoveFromChannelMessage(removerUserId string, removedUser *model.User, channel *model.Channel) *model.AppError { post := &model.Post{ ChannelId: channel.Id, Message: fmt.Sprintf(utils.T("api.channel.remove_member.removed"), removedUser.Username), @@ -890,7 +890,7 @@ func PostRemoveFromChannelMessage(removerUserId string, removedUser *model.User, }, } - if _, err := CreatePost(post, channel.TeamId, false, siteURL); err != nil { + if _, err := CreatePost(post, channel.TeamId, false); err != nil { return model.NewLocAppError("postRemoveFromChannelMessage", "api.channel.post_user_add_remove_message_and_forget.error", nil, err.Error()) } @@ -929,7 +929,7 @@ func removeUserFromChannel(userIdToRemove string, removerUserId string, channel return nil } -func RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel, siteURL string) *model.AppError { +func RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError { var err *model.AppError if err = removeUserFromChannel(userIdToRemove, removerUserId, channel); err != nil { return err @@ -940,7 +940,7 @@ func RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel return err } - go PostRemoveFromChannelMessage(removerUserId, user, channel, siteURL) + go PostRemoveFromChannelMessage(removerUserId, user, channel) return nil } -- cgit v1.2.3-1-g7c22