better user info syncing and show names in mail

This commit is contained in:
Kevin Froman 2018-08-28 20:09:27 -05:00
parent c907558dd1
commit c0c0f838b6
6 changed files with 33 additions and 12 deletions

View file

@ -265,17 +265,21 @@ class Onionr:
return self.cmds
def friendCmd(self):
'''List, add, or remove friend(s)'''
'''List, add, or remove friend(s)
Changes their peer DB entry.
'''
friend = ''
try:
# Get the friend command
action = sys.argv[2]
except IndexError:
logger.info('Syntax: friend add/remove/list [address]')
else:
action = action.lower()
if action == 'list':
# List out peers marked as our friend
for friend in self.onionrCore.listPeers(randomOrder=False, trust=1):
if friend == self.onionrCore._crypto.pubKey:
if friend == self.onionrCore._crypto.pubKey: # do not list our key
continue
friendProfile = onionrusers.OnionrUser(self.onionrCore, friend)
logger.info(friend + ' - ' + friendProfile.getName())