summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--STYLE-GUIDE.md14
-rw-r--r--api/file.go1
-rw-r--r--model/post.go4
-rw-r--r--store/sql_post_store.go8
-rw-r--r--web/react/utils/utils.jsx1
6 files changed, 15 insertions, 15 deletions
diff --git a/README.md b/README.md
index 9d8e5dfd3..1dd9620d6 100644
--- a/README.md
+++ b/README.md
@@ -205,7 +205,7 @@ Contributing
To contribute to this open source project please review the [Mattermost Contribution Guidelines]( http://www.mattermost.org/contribute-to-mattermost/).
-To setup your machine for development of mattermost see: [Developer Machine Setup](scripts/README_DEV.md)
+To setup your machine for development of mattermost see: [Developer Machine Setup](scripts/README_DEV.md).
License
-------
diff --git a/STYLE-GUIDE.md b/STYLE-GUIDE.md
index 0da0a14f8..470788cf5 100644
--- a/STYLE-GUIDE.md
+++ b/STYLE-GUIDE.md
@@ -22,8 +22,8 @@ The following is an abridged version of the [Airbnb Javascript Style Guide](http
### Whitespace
-- Indentation is four spaces
-- Use a space before the leading brace
+- Indentation is four spaces.
+- Use a space before the leading brace.
- Use one space between the comma and the next argument in a bracketed list. No other space.
- Use whitespace to make code more readable.
- Do not use more than one newline to separate code blocks.
@@ -49,7 +49,7 @@ function myFunction ( parm1, parm2 ){
### Semicolons
-- You must use them always
+- You must use them always.
```javascript
// Correct
@@ -85,14 +85,14 @@ var my_variable = 4;
```javascript
// Correct
-if (somthing) {
+if (something) {
stuff...;
} else if (otherthing) {
stuff...;
}
// Incorrect
-if (somthing)
+if (something)
{
stuff...;
}
@@ -102,8 +102,8 @@ else
}
// Incorrect
-if (somthing) stuff...;
-if (somthing)
+if (something) stuff...;
+if (something)
stuff...;
```
diff --git a/api/file.go b/api/file.go
index 50482a057..800c512c5 100644
--- a/api/file.go
+++ b/api/file.go
@@ -347,6 +347,7 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Header().Set("Cache-Control", "max-age=2592000, public")
+ w.Header().Set("Content-Length", strconv.Itoa(len(f)))
w.Write(f)
}
diff --git a/model/post.go b/model/post.go
index f8a3032a3..0c035d4e7 100644
--- a/model/post.go
+++ b/model/post.go
@@ -120,9 +120,7 @@ func (o *Post) PreSave() {
o.OriginalId = ""
- if o.CreateAt <= 0 {
- o.CreateAt = GetMillis()
- }
+ o.CreateAt = GetMillis()
o.UpdateAt = o.CreateAt
if o.Props == nil {
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 4ea28507b..f083a07c9 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -291,7 +291,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE
(UpdateAt > :Time
AND ChannelId = :ChannelId)
- LIMIT 100)
+ LIMIT 1000)
UNION
(SELECT
*
@@ -307,7 +307,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE
UpdateAt > :Time
AND ChannelId = :ChannelId
- LIMIT 100) temp_tab))
+ LIMIT 1000) temp_tab))
ORDER BY CreateAt DESC`,
map[string]interface{}{"ChannelId": channelId, "Time": time})
@@ -319,7 +319,9 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
for _, p := range posts {
list.AddPost(p)
- list.AddOrder(p.Id)
+ if p.UpdateAt > time {
+ list.AddOrder(p.Id)
+ }
}
result.Data = list
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index f0cf17446..34a0d55da 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -289,7 +289,6 @@ function getYoutubeEmbed(link) {
$('.video-uploader.' + youtubeId).html(metadata.channelTitle);
$('.video-title.' + youtubeId).find('a').html(metadata.title);
$('.post-list-holder-by-time').scrollTop($('.post-list-holder-by-time')[0].scrollHeight);
- $('.post-list-holder-by-time').perfectScrollbar('update');
}
if (config.GoogleDeveloperKey) {