mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-19 09:43:29 +00:00
show own content in follows
This commit is contained in:
parent
d7611611e8
commit
501c95f0ab
@ -50,6 +50,15 @@ function getExtendedFollows(callback, k, maxDepth = 3, currentDepth = 1) {
|
||||
callback(k, follows[k]);
|
||||
}
|
||||
|
||||
function removeFollow(k, followDistance, follower) {
|
||||
if (follows[k]) {
|
||||
follows[k].followers.delete(follower);
|
||||
if (followDistance === 1) {
|
||||
State.local.get('groups').get('follows').get(k).put(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addFollow(k, currentDepth - 1);
|
||||
|
||||
State.public.user(k).get('follow').map().on((isFollowing, followedKey) => { // TODO: unfollow
|
||||
@ -59,6 +68,8 @@ function getExtendedFollows(callback, k, maxDepth = 3, currentDepth = 1) {
|
||||
if (currentDepth < maxDepth) {
|
||||
getExtendedFollows(callback, followedKey, maxDepth, currentDepth + 1);
|
||||
}
|
||||
} else {
|
||||
removeFollow(followedKey, currentDepth, k);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -36,9 +36,7 @@ class MessageFeed extends Component {
|
||||
if (this.props.node) {
|
||||
this.props.node.map().on((...args) => this.handleMessage(...args));
|
||||
} else if (this.props.group && this.props.path) { // TODO: make group use the same basic gun api
|
||||
const group = this.props.group === 'follows' ?
|
||||
State.public.user().get('follow') :
|
||||
State.local.get('groups').get(this.props.group);
|
||||
const group = State.local.get('groups').get(this.props.group);
|
||||
State.group(group).map(this.props.path, (...args) => this.handleMessage(...args));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user