Mute: Add user_keypair to MutelistManager
The user keypair is necessary to determine whether or not a given event is muted or not. Previously, the user keypair had to be passed on each function call as an optional parameter, and word filtering would not work unless the caller remembered to add the keypair parameter. All usages of MutelistManager functions indicate that the desired base keypair is always the same as the DamusState's keypair that owns the MutelistManager. Therefore, it is simpler and less error prone to simply pass the keypair to MutelistManager during its initialization. Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
dcd7b5b111
commit
e981ae247e
@@ -28,7 +28,7 @@ struct NotificationExtensionState: HeadlessDamusState {
|
||||
self.settings = UserSettingsStore()
|
||||
|
||||
self.contacts = Contacts(our_pubkey: keypair.pubkey)
|
||||
self.mutelist_manager = MutelistManager()
|
||||
self.mutelist_manager = MutelistManager(user_keypair: keypair)
|
||||
self.keypair = keypair
|
||||
self.profiles = Profiles(ndb: ndb)
|
||||
self.zaps = Zaps(our_pubkey: keypair.pubkey)
|
||||
|
||||
Reference in New Issue
Block a user