...
 
Commits (3)
......@@ -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;
......
......@@ -192,7 +192,7 @@ function read_netuser(username, netaddr)
return obj;
}
function read(usernum, username, netaddr)
function read(usernum, username, netaddr, bbsid)
{
var usernum = parseInt(usernum, 10);
var obj = cache_get(usernum >= 1 ? usernum : username, netaddr);
......@@ -202,8 +202,17 @@ function read(usernum, username, netaddr)
obj = read_localuser(usernum);
else if(!netaddr)
obj = read_localuser(system.matchuser(username));
else
else {
obj = read_netuser(username, netaddr);
if(!obj && bbsid)
obj = read_netuser(username, bbsid);
if(!obj) {
var namehash = "md5:" + md5_calc(username);
obj = read_netuser(namehash, netaddr);
if(!obj && bbsid)
obj = read_netuser(namehash, bbsid);
}
}
cache_set(usernum >= 1 ? usernum : username, obj, netaddr);
return obj;
}
......@@ -262,7 +271,7 @@ function is_enabled(obj)
// Uses Graphic.draw() at an absolute screen coordinate
function draw(usernum, username, netaddr, above, right, top)
{
var avatar = this.read(usernum, username, netaddr);
var avatar = this.read(usernum, username, netaddr, usernum);
if(!is_enabled(avatar))
return false;
return draw_bin(avatar.data, above, right, top);
......@@ -297,7 +306,7 @@ function draw_bin(data, above, right, top)
// Uses console.write() where-ever the cursor happens to be
function show(usernum, username, netaddr)
{
var avatar = this.read(usernum, username, netaddr);
var avatar = this.read(usernum, username, netaddr, usernum);
if(!is_enabled(avatar))
return false;
return show_bin(avatar.data);
......
......@@ -50,7 +50,8 @@ if(!(bbs.msg_attr&bbs.mods.smbdefs.MSG_ANONYMOUS)) {
if(!bbs.mods.avatar_lib)
bbs.mods.avatar_lib = load({}, 'avatar_lib.js');
var options = get_options();
var success = bbs.mods.avatar_lib.draw(bbs.msg_from_ext, bbs.msg_from, bbs.msg_from_net
var success = bbs.mods.avatar_lib.draw(bbs.msg_from_ext || bbs.msg_from_bbsid
,bbs.msg_from, bbs.msg_from_net
,options.msghdr_draw_above, options.msghdr_draw_right
,options.msghdr_draw_top && bbs.msghdr_top_of_screen);
if(!success && bbs.smb_sub_code) {
......