Skip to content

Commit cba3d95

Browse files
committed
Change Trust Local Notes to alias
Making local notes show contact alias rather than contact ID (which is harder to understand)
1 parent 1617d34 commit cba3d95

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

android/tinySSB/app/src/main/assets/web/prod/contacts.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,15 @@ function show_contact_details(id) {
192192

193193
const sliderValue = slider.value;
194194

195-
// Example condition for error
195+
if (sliderValue == c['trusted']) {
196+
errorMessage.textContent = "Contact's trust level is already set to " + sliderValue + ".";
197+
return
198+
}
199+
196200
if (sliderValue == 2) {
197201
//check if current trust level is 2
198202
if (c['trusted'] == 2) {
199-
errorMessage.textContent = "Error: Contact's trust level is already 2.";
203+
errorMessage.textContent = "Contact's trust level is already 2.";
200204
return;
201205
}
202206
errorMessage.textContent = "Error: To set a contact's trust level to 2, you must scan their QR Code.";

android/tinySSB/app/src/main/assets/web/tremola.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,11 @@ function b2f_new_event(e) { // incoming SSB log event: we get map with three ent
634634
// console.log("new post 1 ", ch)
635635
if (!(e.header.ref in ch.posts)) { // new post
636636
var a = e.confid;
637+
638+
//get alias from fid
639+
var alias = tremola.contacts[encodeScuttlebuttId(a[2])].alias;
637640
var p = {
638-
"key": e.header.ref, "from": e.header.fid, "body": "Set contact: " + a[2] + "'s trust level to " + a[3],
641+
"key": e.header.ref, "from": e.header.fid, "body": "Set contact: " + alias + "'s trust level to " + a[3],
639642
"when": a[4] * 1000, "prev": a[1]
640643
};
641644
// console.log("new post 2 ", JSON.stringify(p))

0 commit comments

Comments
 (0)