damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 4c37bfc128a6d3feab1c6fd792f4c88d35ccb25d
parent 548af2bf9d9c240853a28571f5540ce9c8a51635
Author: Charlie Fish <contact@charlie.fish>
Date:   Tue,  2 Jan 2024 17:28:02 -0700

profile: filter events that don’t match pubkey

Closes: https://github.com/damus-io/damus/issues/1846
Lightning-Invoice: lnbc1pjef2gupp5ffv0he47r6s6us9s2pfxy023mx8lutwlh3sq365rzgmmj6efl8nsdqqcqzpgxqrrs0fppq65gwnyvf5pn5zj5ryx9s4n7y58clk7yqsp5v7pa2ges4rgvtt0nh6lnt4cevm8n2ql9p7kqstwfp4wutf8faa8q9qyyssqwx8t9kk0m3jj6vu0kvftl3nc8zqyfl5l8ne058q5dnqyad3cqfz8vdnna5g0vy9f2ttwugc0sr20p0hsem84g8xd85ptnwgmryrf4lqqmygv34
Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Changelog-Fixed: Fixed bug where sometimes notes from other profiles appear on profile pages

Diffstat:
Mdamus/Models/ProfileModel.swift | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/damus/Models/ProfileModel.swift b/damus/Models/ProfileModel.swift @@ -118,6 +118,11 @@ class ProfileModel: ObservableObject, Equatable { case .ok: break case .event(_, let ev): + // Ensure the event public key matches this profiles public key + // This is done to protect against a relay not properly filtering events by the pubkey + // See https://github.com/damus-io/damus/issues/1846 for more information + guard self.pubkey == ev.pubkey else { break } + add_event(ev) case .notice: break