Changes to how author name is passed to pdf-reader and pdf-worker

This commit is contained in:
Martynas Bagdonas 2022-02-09 16:49:16 +02:00
parent 8c846468f2
commit ee3e28e126
4 changed files with 11 additions and 6 deletions

View file

@ -121,12 +121,14 @@ Zotero.Annotations = new function () {
var isGroup = item.library.libraryType == 'group';
if (item.annotationAuthorName) {
o.authorName = item.annotationAuthorName;
if (isGroup) {
o.lastModifiedByUser = Zotero.Users.getName(item.lastModifiedByUserID)
|| Zotero.Users.getName(item.createdByUserID);
}
}
else if (!o.isExternal && isGroup) {
o.authorName = Zotero.Users.getName(item.createdByUserID);
}
if (o.authorName && isGroup) {
o.lastModifiedByUser = Zotero.Users.getName(item.lastModifiedByUserID)
o.isAuthorNameAuthoritative = true;
}
o.readOnly = o.isExternal || !isAuthor;
if (o.type == 'highlight') {

View file

@ -157,7 +157,10 @@ class PDFWorker {
annotations.push({
id: item.key,
type: item.annotationType,
authorName: Zotero.Users.getName(item.createdByUserID) || Zotero.Users.getCurrentUsername() || '',
// Author name is only set when the PDF file is 1) in a group library,
// 2) was moved back to a private library or 3) was imported from a PDF file
// that was previously exported in 1) or 2) case
authorName: item.annotationAuthorName || Zotero.Users.getName(item.createdByUserID) || '',
comment: (item.annotationComment || '').replace(/<\/?(i|b|sub|sup)>/g, ''),
color: item.annotationColor,
position: JSON.parse(item.annotationPosition),

@ -1 +1 @@
Subproject commit 2a48fc038c551e58d7574daabcab3d3a818ec846
Subproject commit 4f14537a31ed66152d99a949d554b8e7ef7f1260

@ -1 +1 @@
Subproject commit c785b5148a72cfd67e7dd95b1342f18e4bb60cdd
Subproject commit fedade7ffde74e281d11205f02acfac2c1c1376e