add editpeer to changelog, record name/contact changes of peers
This commit is contained in:
parent
bae70fd829
commit
8267fa8b39
4 changed files with 73 additions and 42 deletions
|
|
@ -61,11 +61,20 @@ def setPreferences(data):
|
|||
'sub.key': value
|
||||
}
|
||||
'''
|
||||
|
||||
change_contact = 'contact' in data and \
|
||||
data['contact'] != settings.preferences['contact']
|
||||
change_username = 'username' in data and \
|
||||
data['username'] != settings.preferences['username']
|
||||
update_dict(settings.preferences, data)
|
||||
if 'username' in data:
|
||||
u = state.user()
|
||||
u.update_name()
|
||||
u.save()
|
||||
if change_username:
|
||||
Changelog.record(u, 'editusername', data['username'])
|
||||
if change_contact:
|
||||
Changelog.record(state.user(), 'editcontact', data['contact'])
|
||||
return settings.preferences
|
||||
actions.register(setPreferences)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue