mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 00:11:01 +00:00
Decrement WoT scores when you unfollow someone
This commit is contained in:
parent
5bbe1d5ab3
commit
0ff322b682
@ -733,6 +733,18 @@ impl People {
|
||||
|
||||
// Don't remove from relay picker here. They might still be on other
|
||||
// lists. Garbage collection will eventually clean it up.
|
||||
|
||||
// Update Web of Trust scores
|
||||
if list == PersonList::Followed {
|
||||
use crate::storage::{FollowingsTable, Table};
|
||||
let mut txn = GLOBALS.db().get_write_txn()?;
|
||||
if let Some(followings) = FollowingsTable::read_record(*pubkey, Some(&mut txn))? {
|
||||
for followed in followings.followed.iter() {
|
||||
GLOBALS.db().decr_wot(*followed, Some(&mut txn))?;
|
||||
}
|
||||
}
|
||||
txn.commit()?;
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALS.ui_people_to_invalidate.write().push(*pubkey);
|
||||
|
Loading…
Reference in New Issue
Block a user