Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
bf5f55a6
Commit
bf5f55a6
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Download
Email Patches
Plain Diff
Fix live status removal from public/hashtag channels
parent
aabf884c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/assets/javascripts/components/features/hashtag_timeline/index.jsx
+8
-2
...avascripts/components/features/hashtag_timeline/index.jsx
app/assets/javascripts/components/features/public_timeline/index.jsx
+12
-6
...javascripts/components/features/public_timeline/index.jsx
app/services/fan_out_on_write_service.rb
+2
-2
app/services/fan_out_on_write_service.rb
with
22 additions
and
10 deletions
+22
-10
app/assets/javascripts/components/features/hashtag_timeline/index.jsx
+
8
-
2
View file @
bf5f55a6
...
...
@@ -4,7 +4,8 @@ import StatusListContainer from '../ui/containers/status_list_container';
import
Column
from
'
../ui/components/column
'
;
import
{
refreshTimeline
,
updateTimeline
updateTimeline
,
deleteFromTimelines
}
from
'
../../actions/timelines
'
;
const
HashtagTimeline
=
React
.
createClass
({
...
...
@@ -24,7 +25,12 @@ const HashtagTimeline = React.createClass({
},
{
received
(
data
)
{
dispatch
(
updateTimeline
(
'
tag
'
,
JSON
.
parse
(
data
.
message
)));
switch
(
data
.
type
)
{
case
'
update
'
:
return
dispatch
(
updateTimeline
(
'
tag
'
,
JSON
.
parse
(
data
.
message
)));
case
'
delete
'
:
return
dispatch
(
deleteFromTimelines
(
data
.
id
));
}
}
});
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/components/features/public_timeline/index.jsx
+
12
-
6
View file @
bf5f55a6
import
{
connect
}
from
'
react-redux
'
;
import
PureRenderMixin
from
'
react-addons-pure-render-mixin
'
;
import
{
connect
}
from
'
react-redux
'
;
import
PureRenderMixin
from
'
react-addons-pure-render-mixin
'
;
import
StatusListContainer
from
'
../ui/containers/status_list_container
'
;
import
Column
from
'
../ui/components/column
'
;
import
Column
from
'
../ui/components/column
'
;
import
{
refreshTimeline
,
updateTimeline
}
from
'
../../actions/timelines
'
;
updateTimeline
,
deleteFromTimelines
}
from
'
../../actions/timelines
'
;
const
PublicTimeline
=
React
.
createClass
({
...
...
@@ -24,7 +25,12 @@ const PublicTimeline = React.createClass({
this
.
subscription
=
App
.
cable
.
subscriptions
.
create
(
'
PublicChannel
'
,
{
received
(
data
)
{
dispatch
(
updateTimeline
(
'
public
'
,
JSON
.
parse
(
data
.
message
)));
switch
(
data
.
type
)
{
case
'
update
'
:
return
dispatch
(
updateTimeline
(
'
public
'
,
JSON
.
parse
(
data
.
message
)));
case
'
delete
'
:
return
dispatch
(
deleteFromTimelines
(
data
.
id
));
}
}
});
...
...
This diff is collapsed.
Click to expand it.
app/services/fan_out_on_write_service.rb
+
2
-
2
View file @
bf5f55a6
...
...
@@ -42,12 +42,12 @@ class FanOutOnWriteService < BaseService
Rails
.
logger
.
debug
"Delivering status
#{
status
.
id
}
to hashtags"
status
.
tags
.
find_each
do
|
tag
|
FeedManager
.
instance
.
broadcast
(
"hashtag:
#{
tag
.
name
}
"
,
id:
status
.
id
)
FeedManager
.
instance
.
broadcast
(
"hashtag:
#{
tag
.
name
}
"
,
type:
'update'
,
id:
status
.
id
)
end
end
def
deliver_to_public
(
status
)
Rails
.
logger
.
debug
"Delivering status
#{
status
.
id
}
to public timeline"
FeedManager
.
instance
.
broadcast
(
:public
,
id:
status
.
id
)
FeedManager
.
instance
.
broadcast
(
:public
,
type:
'update'
,
id:
status
.
id
)
end
end
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets