mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Merge pull request #3859 from matrix-org/erikj/add_iterkeys
Fix handling of redacted events from federation
This commit is contained in:
commit
cb64fe2cb7
1
changelog.d/3859.bugfix
Normal file
1
changelog.d/3859.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix handling of redacted events from federation
|
@ -13,6 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import six
|
||||
|
||||
from synapse.util.caches import intern_dict
|
||||
from synapse.util.frozenutils import freeze
|
||||
|
||||
@ -147,6 +149,9 @@ class EventBase(object):
|
||||
def items(self):
|
||||
return list(self._event_dict.items())
|
||||
|
||||
def keys(self):
|
||||
return six.iterkeys(self._event_dict)
|
||||
|
||||
|
||||
class FrozenEvent(EventBase):
|
||||
def __init__(self, event_dict, internal_metadata_dict={}, rejected_reason=None):
|
||||
|
@ -153,7 +153,7 @@ class FederationBase(object):
|
||||
# *actual* redacted copy to be on the safe side.)
|
||||
redacted_event = prune_event(pdu)
|
||||
if (
|
||||
set(six.iterkeys(redacted_event)) == set(six.iterkeys(pdu)) and
|
||||
set(redacted_event.keys()) == set(pdu.keys()) and
|
||||
set(six.iterkeys(redacted_event.content))
|
||||
== set(six.iterkeys(pdu.content))
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user