diff --git a/src/httpapi/friendsapi/__init__.py b/src/httpapi/friendsapi/__init__.py index 329ea7f4..03a20153 100755 --- a/src/httpapi/friendsapi/__init__.py +++ b/src/httpapi/friendsapi/__init__.py @@ -24,6 +24,15 @@ from coredb import keydb friends = Blueprint('friends', __name__) +@friends.route('/friends/listall') +def list_all(): + pubkey_list = {} + friend_list = contactmanager.ContactManager.list_friends(0) + for friend in friend_list: + pubkey_list[friend.publicKey] = {'name': friend.get_info('name')} + return json.dumps(pubkey_list) + + @friends.route('/friends/list') def list_friends(): pubkey_list = {} diff --git a/src/onionrusers/onionrusers.py b/src/onionrusers/onionrusers.py index 21263772..70cd8299 100755 --- a/src/onionrusers/onionrusers.py +++ b/src/onionrusers/onionrusers.py @@ -252,8 +252,8 @@ class OnionrUser: return True @classmethod - def list_friends(cls): + def list_friends(cls, trust_level=1): friendList = [] - for x in keydb.listkeys.list_peers(trust=1): + for x in keydb.listkeys.list_peers(trust=trust_level): friendList.append(cls(x)) return list(friendList) diff --git a/static-data/default-plugins/pms/info.json b/static-data/default-plugins/pms/info.json index 72ce2b39..83f1c5fb 100755 --- a/static-data/default-plugins/pms/info.json +++ b/static-data/default-plugins/pms/info.json @@ -1,5 +1,5 @@ { "name" : "pms", - "version" : "0.1.2", + "version" : "0.1.3", "author" : "onionr" } diff --git a/static-data/default-plugins/pms/main.py b/static-data/default-plugins/pms/main.py index 4d2219f2..6fb08a8c 100755 --- a/static-data/default-plugins/pms/main.py +++ b/static-data/default-plugins/pms/main.py @@ -31,7 +31,7 @@ import notifier locale.setlocale(locale.LC_ALL, '') plugin_name = 'pms' -PLUGIN_VERSION = '0.1.2' +PLUGIN_VERSION = '0.1.3' sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) import sentboxdb, mailapi, loadinbox # import after path insert diff --git a/static-data/default-plugins/pms/web/index.html b/static-data/default-plugins/pms/web/index.html index c838d30b..f4603633 100755 --- a/static-data/default-plugins/pms/web/index.html +++ b/static-data/default-plugins/pms/web/index.html @@ -240,7 +240,7 @@