Commit 5f088ad2 authored by Rob Swindell's avatar Rob Swindell

By default, export MD5 digest of real name associated with an avatar

This enables Avatar displays on real-name-only networks without leaking
real names into the SYNCDATA sub.

If the -realnames option is used, the unobscured full real names are
exported (as before).

If the (new) -aliasonly option is used, even the MD5 digest of users'
real names is left out.
parent 292c4acc
......@@ -366,8 +366,12 @@ function export_users(msgbase, realnames, all)
if(!list.disabled)
list.disabled = [];
list.disabled.push(u.alias);
if(realnames)
list.disabled.push(u.name);
if(u.name != u.alias) {
if(realnames)
list.disabled.push(u.name);
else if(realnames !== false)
list.disabled.push("md5:" + md5_calc(u.name));
}
} else {
if(!lib.is_enabled(avatar)) {
alert("Invalid avatar for user #" + n);
......@@ -378,8 +382,12 @@ function export_users(msgbase, realnames, all)
if(!list[data])
list[data] = [];
list[data].push(u.alias);
if(realnames && u.name != u.alias)
list[data].push(u.name);
if(u.name != u.alias) {
if(realnames)
list[data].push(u.name);
else if(realnames !== false)
list[data].push("md5:" + md5_calc(u.name));
}
}
avatar.last_exported = new Date();
avatar.export_count++;
......@@ -541,7 +549,7 @@ function main()
var cmd;
var i;
var offset;
var realnames = false;
var realnames;
var ptr;
var limit;
var all;
......@@ -571,6 +579,9 @@ function main()
case '-realnames':
realnames = true;
break;
case '-aliasonly':
realnames = false;
break;
case "-ptr":
ptr = val;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment