summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/help/Search.md3
-rw-r--r--doc/integrations/webhooks/Incoming-Webhooks.md4
-rw-r--r--store/sql_channel_store.go20
-rw-r--r--store/store.go1
-rw-r--r--web/sass-files/sass/partials/_modal.scss1
-rw-r--r--web/sass-files/sass/partials/_settings.scss4
6 files changed, 25 insertions, 8 deletions
diff --git a/doc/help/Search.md b/doc/help/Search.md
index 51095aac6..354e29a43 100644
--- a/doc/help/Search.md
+++ b/doc/help/Search.md
@@ -7,7 +7,8 @@ The search box in Mattermost brings back results from any channel of which youâ€
- Multiple search terms are connected with “OR” by default. Typing in `Mattermost website` returns results containing “Mattermost” or “website”
- Use `from:` to find posts from specific users and `in:` to find posts in specific channels. For example: Searching `Mattermost in:town-square` only returns messages in Town Square that contain `Mattermost`
- Use quotes to return search results for exact terms. For example: Searching `"Mattermost website"` returns messages containing the entire phrase `"Mattermost website"` and not messages containing only `Mattermost` or `website`
-- Use the `*` character for wildcard searches that match within words. For example: Searching for `rea*` brings back messages containing `reach`, `reason` and other words starting with `rea`.
+- Use the `*` character for wildcard searches that match within words. For example: Searching for `rea*` brings back messages containing `reach`, `reason` and other words starting with `rea`
+- Click on the **Jump** link on the right of a search result to view the post archive in the center channel
#### Limitations:
diff --git a/doc/integrations/webhooks/Incoming-Webhooks.md b/doc/integrations/webhooks/Incoming-Webhooks.md
index 5e93c4ac7..7373892ad 100644
--- a/doc/integrations/webhooks/Incoming-Webhooks.md
+++ b/doc/integrations/webhooks/Incoming-Webhooks.md
@@ -1,6 +1,6 @@
# Incoming Webhooks
-Incoming webhooks allow external applications, written in the programming language of your choice--to post messages into Mattermost channels and private groups by sending a specifically formatted JSON payload via HTTP POST request to a secret Mattermost URL generated specifically for each application.
+Incoming webhooks allow external applications, written in the programming language of your choice--to post messages into Mattermost channels, private groups and direct messages by sending a specifically formatted JSON payload via HTTP POST request to a secret Mattermost URL generated specifically for each application.
A couple key points:
@@ -69,7 +69,7 @@ Additional Notes:
1. For the HTTP request body, if `Content-Type` is specified as `application/json` in the headers of the HTTP request then the body of the request can be direct JSON. For example, ```{"text": "Hello, this is some text."}```
-2. You can override the channel specified in the webhook definition by specifying a `channel` parameter in your payload. For example, you might have a single webhook created for _Town Square_, but you can use ```payload={"channel": "off-topic", "text": "Hello, this is some text."}``` to send a message to the _Off-Topic_ channel using the same webhook URL
+2. You can override the channel specified in the webhook definition by specifying a `channel` parameter in your payload. For example, you might have a single webhook created for _Town Square_, but you can use ```payload={"channel": "off-topic", "text": "Hello, this is some text."}``` to send a message to the _Off-Topic_ channel using the same webhook URL. If an `@` symbol followed by a username is specified, then the message will be sent to that user's direct message channel
1. In addition, with **Enable Overriding of Usernames from Webhooks** turned on, you can also override the username the message posts as by providing a `username` parameter in your JSON payload. For example, you might want your message looking like it came from a robot so you can use ```payload={"username": "robot", "text": "Hello, this is some text."}``` to change the username of the post to robot. Note, to combat any malicious users from trying to use this to perform [phishing attacks](https://en.wikipedia.org/wiki/Phishing) a `BOT` indicator appears next to posts coming from webhooks
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 728f44bc9..b68774189 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -241,13 +241,27 @@ func (s SqlChannelStore) extraUpdated(channel *model.Channel) StoreChannel {
}
func (s SqlChannelStore) Get(id string) StoreChannel {
+ return s.get(id, false)
+}
+
+func (s SqlChannelStore) GetFromMaster(id string) StoreChannel {
+ return s.get(id, true)
+}
+
+func (s SqlChannelStore) get(id string, master bool) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
result := StoreResult{}
- // reading from master due to expected race condition when creating channels
- if obj, err := s.GetMaster().Get(model.Channel{}, id); err != nil {
+ var db *gorp.DbMap
+ if master {
+ db = s.GetMaster()
+ } else {
+ db = s.GetReplica()
+ }
+
+ if obj, err := db.Get(model.Channel{}, id); err != nil {
result.Err = model.NewAppError("SqlChannelStore.Get", "We encountered an error finding the channel", "id="+id+", "+err.Error())
} else if obj == nil {
result.Err = model.NewAppError("SqlChannelStore.Get", "We couldn't find the existing channel", "id="+id)
@@ -439,7 +453,7 @@ func (s SqlChannelStore) SaveMember(member *model.ChannelMember) StoreChannel {
go func() {
var result StoreResult
// Grab the channel we are saving this member to
- if cr := <-s.Get(member.ChannelId); cr.Err != nil {
+ if cr := <-s.GetFromMaster(member.ChannelId); cr.Err != nil {
result.Err = cr.Err
} else {
channel := cr.Data.(*model.Channel)
diff --git a/store/store.go b/store/store.go
index 0695ea27f..682195148 100644
--- a/store/store.go
+++ b/store/store.go
@@ -60,6 +60,7 @@ type ChannelStore interface {
SaveDirectChannel(channel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) StoreChannel
Update(channel *model.Channel) StoreChannel
Get(id string) StoreChannel
+ GetFromMaster(id string) StoreChannel
Delete(channelId string, time int64) StoreChannel
PermanentDeleteByTeam(teamId string) StoreChannel
GetByName(team_id string, domain string) StoreChannel
diff --git a/web/sass-files/sass/partials/_modal.scss b/web/sass-files/sass/partials/_modal.scss
index 9279cf0c4..a082ffb22 100644
--- a/web/sass-files/sass/partials/_modal.scss
+++ b/web/sass-files/sass/partials/_modal.scss
@@ -394,7 +394,6 @@
.modal-body {
padding: 10px 0 20px;
- @include clearfix;
}
.filter-row {
diff --git a/web/sass-files/sass/partials/_settings.scss b/web/sass-files/sass/partials/_settings.scss
index f078cafb4..473ffb28d 100644
--- a/web/sass-files/sass/partials/_settings.scss
+++ b/web/sass-files/sass/partials/_settings.scss
@@ -183,7 +183,7 @@
text-align: right;
margin-bottom: 5px;
.fa {
- margin-right: 7px;
+ margin-right: 5px;
font-size: 12px;
@include opacity(0.5);
display: none;
@@ -335,6 +335,8 @@
.fa {
margin-right: 5px;
+ @include opacity(0.5);
+ font-size: 12px;
}
.member-menu {