The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/server/lib/attachmentActivityActor.js

16 lines
803 B

/**
* Pure helper to determine which user should be credited for an attachment
* activity (specifically the 'deleteAttachment' activity).
*
* Bug #5504: when an attachment is deleted, the activity must record the user
* who actually performed the removal (the acting user), not the original
* uploader. When no acting user is available (e.g. a server/system removal),
* fall back to the uploader so the activity still has a sensible userId.
*
* @param {string|null|undefined} actingUserId the user performing the removal
* @param {string|null|undefined} uploaderUserId the original uploader
* @returns {string|null|undefined} actingUserId if present, otherwise uploaderUserId
*/
export function deleteActivityUserId(actingUserId, uploaderUserId) {
return actingUserId || uploaderUserId;
}