]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #529 - Make hashtag timelines show conversations, fix hashtag loading in the UI
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 31 Jan 2017 21:34:33 +0000 (22:34 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 31 Jan 2017 21:35:38 +0000 (22:35 +0100)
app/assets/javascripts/components/actions/timelines.jsx
app/assets/javascripts/components/features/account_timeline/index.jsx
app/assets/javascripts/components/features/followers/index.jsx
app/assets/javascripts/components/features/following/index.jsx
app/models/status.rb
app/services/fan_out_on_write_service.rb

index 29a060e87ab1de6a5bfeaabeca6b1dc8e8f8e5f2..1531b89a33de3f2b2e5277888f29870551e0c274 100644 (file)
@@ -74,7 +74,7 @@ export function refreshTimeline(timeline, id = null) {
     let path        = timeline;
     let skipLoading = false;
 
-    if (newestId !== null && getState().getIn(['timelines', timeline, 'loaded'])) {
+    if (newestId !== null && getState().getIn(['timelines', timeline, 'loaded']) && (id === null || getState().getIn(['timelines', timeline, 'id']) === id)) {
       params      = `?since_id=${newestId}`;
       skipLoading = true;
     }
@@ -112,7 +112,7 @@ export function expandTimeline(timeline, id = null) {
       return;
     }
 
-    dispatch(expandTimelineRequest(timeline));
+    dispatch(expandTimelineRequest(timeline, id));
 
     let path = timeline;
 
@@ -133,10 +133,11 @@ export function expandTimeline(timeline, id = null) {
   };
 };
 
-export function expandTimelineRequest(timeline) {
+export function expandTimelineRequest(timeline, id) {
   return {
     type: TIMELINE_EXPAND_REQUEST,
-    timeline
+    timeline,
+    id
   };
 };
 
index 6613600ccea53bba4880693ad34692005c7c689a..3495102956c46e1f4da6ab933d13f1cbe69e77d8 100644 (file)
@@ -11,9 +11,10 @@ import LoadingIndicator from '../../components/loading_indicator';
 import Column from '../ui/components/column';
 import HeaderContainer from './containers/header_container';
 import ColumnBackButton from '../../components/column_back_button';
+import Immutable from 'immutable';
 
 const mapStateToProps = (state, props) => ({
-  statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'items']),
+  statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'items'], Immutable.List()),
   isLoading: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'isLoading']),
   me: state.getIn(['meta', 'me'])
 });
@@ -49,7 +50,7 @@ const AccountTimeline = React.createClass({
   render () {
     const { statusIds, isLoading, me } = this.props;
 
-    if (!statusIds) {
+    if (!statusIds && isLoading) {
       return (
         <Column>
           <LoadingIndicator />
index 1b9548c7e7cc70c7c63b7aef063baa346e2c6765..bcadf60104047f872d8ce6427a341ba54062f48c 100644 (file)
@@ -67,6 +67,7 @@ const Followers = React.createClass({
     return (
       <Column>
         <ColumnBackButton />
+
         <ScrollContainer scrollKey='followers'>
           <div className='scrollable' onScroll={this.handleScroll}>
             <div>
index 2a799ac42f762070371a4a7b96489780b674e1db..f67cc797f673ccaf9a70b30df8a2d654163a82a4 100644 (file)
@@ -67,6 +67,7 @@ const Following = React.createClass({
     return (
       <Column>
         <ColumnBackButton />
+
         <ScrollContainer scrollKey='following'>
           <div className='scrollable' onScroll={this.handleScroll}>
             <div>
index 651d0dbc9ac83cb848daef3d54ee5b0a67a10619..99e167bc92e5360052d332724450e9367aacd28c 100644 (file)
@@ -119,7 +119,6 @@ class Status < ApplicationRecord
       query = tag.statuses
                  .joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id')
                  .where(visibility: :public)
-                 .where('(statuses.in_reply_to_id IS NULL OR statuses.in_reply_to_account_id = statuses.account_id)')
                  .where('statuses.reblog_of_id IS NULL')
 
       account.nil? ? filter_timeline_default(query) : filter_timeline_default(filter_timeline(query, account))
index fc2ad6794190d966f3e10b9aa5e5e25a31886403..4f387c6c242df330c86ab54b509deac7bece8f84 100644 (file)
@@ -8,9 +8,12 @@ class FanOutOnWriteService < BaseService
     deliver_to_followers(status)
     deliver_to_mentioned(status)
 
-    return if status.account.silenced? || !status.public_visibility? || status.reblog? || (status.reply? && status.in_reply_to_account_id != status.account_id)
+    return if status.account.silenced? || !status.public_visibility? || status.reblog?
 
     deliver_to_hashtags(status)
+
+    return if status.reply? && status.in_reply_to_account_id != status.account_id
+
     deliver_to_public(status)
   end