mirror of https://github.com/xwiki-labs/cryptpad
don't log presence of other users as 'joins' when you have first joined
This commit is contained in:
parent
325f685f3e
commit
4c0049ad55
|
@ -921,6 +921,7 @@ define([
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var joined = false;
|
||||||
metadataMgr.onChange(function () {
|
metadataMgr.onChange(function () {
|
||||||
var newdata = metadataMgr.getMetadata().users;
|
var newdata = metadataMgr.getMetadata().users;
|
||||||
var netfluxIds = Object.keys(newdata);
|
var netfluxIds = Object.keys(newdata);
|
||||||
|
@ -949,7 +950,7 @@ define([
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (var k in newdata) {
|
for (var k in newdata) {
|
||||||
if (k !== userNetfluxId && netfluxIds.indexOf(k) !== -1) {
|
if (joined && k !== userNetfluxId && netfluxIds.indexOf(k) !== -1) {
|
||||||
if (typeof oldUserData[k] === "undefined") {
|
if (typeof oldUserData[k] === "undefined") {
|
||||||
// if the same uid is already present in the userdata, don't notify
|
// if the same uid is already present in the userdata, don't notify
|
||||||
if (!userPresent(k, newdata[k], oldUserData)) {
|
if (!userPresent(k, newdata[k], oldUserData)) {
|
||||||
|
@ -960,6 +961,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
joined = true;
|
||||||
oldUserData = JSON.parse(JSON.stringify(newdata));
|
oldUserData = JSON.parse(JSON.stringify(newdata));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue