From 4c37bfc128a6d3feab1c6fd792f4c88d35ccb25d Mon Sep 17 00:00:00 2001 From: Charlie Fish Date: Tue, 2 Jan 2024 17:28:02 -0700 Subject: [PATCH] =?UTF-8?q?profile:=20filter=20events=20that=20don?= =?UTF-8?q?=E2=80=99t=20match=20pubkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://github.com/damus-io/damus/issues/1846 Lightning-Invoice: lnbc1pjef2gupp5ffv0he47r6s6us9s2pfxy023mx8lutwlh3sq365rzgmmj6efl8nsdqqcqzpgxqrrs0fppq65gwnyvf5pn5zj5ryx9s4n7y58clk7yqsp5v7pa2ges4rgvtt0nh6lnt4cevm8n2ql9p7kqstwfp4wutf8faa8q9qyyssqwx8t9kk0m3jj6vu0kvftl3nc8zqyfl5l8ne058q5dnqyad3cqfz8vdnna5g0vy9f2ttwugc0sr20p0hsem84g8xd85ptnwgmryrf4lqqmygv34 Signed-off-by: Charlie Fish Reviewed-by: William Casarin Signed-off-by: William Casarin Changelog-Fixed: Fixed bug where sometimes notes from other profiles appear on profile pages --- damus/Models/ProfileModel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/damus/Models/ProfileModel.swift b/damus/Models/ProfileModel.swift index 15941596..8d6dbbae 100644 --- 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