Refactor statusToTextMentions, fixes #80

stable/1.0.x
Alex Gleason 2020-05-17 17:22:32 -05:00
rodzic b78e923f83
commit ed61603b10
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -79,14 +79,15 @@ const initialPoll = ImmutableMap({
});
function statusToTextMentions(state, status) {
let set = ImmutableOrderedSet([]);
const me = state.get('me');
const me = state.getIn(['accounts', state.get('me'), 'acct']);
const author = state.getIn(['accounts', status.get('account'), 'acct']);
const mentions = status.get('mentions', []).map(m => m.get('acct'));
if (status.getIn(['account', 'id']) !== me) {
set = set.add(`@${status.getIn(['account', 'acct'])} `);
}
return set.union(status.get('mentions').filterNot(mention => mention.get('id') === me).map(mention => `@${mention.get('acct')} `)).join('');
return ImmutableOrderedSet([author])
.concat(mentions)
.delete(me)
.map(m => `@${m} `)
.join('');
};
function clearAll(state) {