mirror of https://gitlab.com/bashrc2/epicyon
Use attachment index
parent
a0b20fbf64
commit
d3a42f862d
17
outbox.py
17
outbox.py
|
@ -127,22 +127,21 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {},
|
||||||
continue
|
continue
|
||||||
if 'attachment' in actorJson:
|
if 'attachment' in actorJson:
|
||||||
found = False
|
found = False
|
||||||
ctr = 0
|
for attachIdx in range(len(actorJson['attachment'])):
|
||||||
for propertyValue in actorJson['attachment']:
|
if actorJson['attachment'][attachIdx]['type'] != \
|
||||||
if propertyValue != 'PropertyValue':
|
'PropertyValue':
|
||||||
ctr += 1
|
|
||||||
continue
|
continue
|
||||||
if propertyValue['name'] != newPropertyValue['name']:
|
if actorJson['attachment'][attachIdx]['name'] != \
|
||||||
ctr += 1
|
newPropertyValue['name']:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if propertyValue['value'] != newPropertyValue['value']:
|
if actorJson['attachment'][attachIdx]['value'] != \
|
||||||
actorJson['attachment'][ctr]['value'] = \
|
newPropertyValue['value']:
|
||||||
|
actorJson['attachment'][attachIdx]['value'] = \
|
||||||
newPropertyValue['value']
|
newPropertyValue['value']
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
ctr += 1
|
|
||||||
if not found:
|
if not found:
|
||||||
actorJson['attachment'].append({
|
actorJson['attachment'].append({
|
||||||
"name": newPropertyValue['name'],
|
"name": newPropertyValue['name'],
|
||||||
|
|
Loading…
Reference in New Issue