richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

fix: get user by display name

Open elzody opened this issue 1 year ago • 4 comments

  • Resolves: #4169
  • Target version: main

Summary

When mentioning a user within a document from Collabora, it seems to search by the user's display name. Thus, if the display name has any whitespace, it will fail to mention the user. The problem is that the backend tries to use the mentioned user string (display name in this case) as the UID, which is not the same. The solution is to first search by the display name to get the proper user object, then use the UID from that to generate the notification and send it to the user.

Checklist

  • [x] Code is properly formatted
  • [x] Sign-off message is added to all commits
  • [x] Documentation (manuals or wiki) has been updated or is not required

elzody avatar Oct 22 '24 17:10 elzody

/backport to stable30

elzody avatar Oct 22 '24 17:10 elzody

/backport to stable29

elzody avatar Oct 22 '24 17:10 elzody

/backport to stable28

elzody avatar Oct 22 '24 17:10 elzody

/backport to stable27

elzody avatar Oct 22 '24 17:10 elzody

What comes to my mind only now is that it probably does not respect various sharing settings, e.g. auto completion of users. Unless the "mention" is filtered somewhere before. Maybe the autocomplete logic (OCP\Collaboration\AutoComplete\IManager) would be better?

blizzz avatar Nov 05 '24 09:11 blizzz

What comes to my mind only now is that it probably does not respect various sharing settings, e.g. auto completion of users.

I think this is already done here in the front end, unless I'm mistaken: https://github.com/nextcloud/richdocuments/blob/404d072a2ca73bd53aeafcca3f7d68745a0f8347/src/mixins/uiMention.js#L19-L21

@blizzz

elzody avatar Nov 06 '24 18:11 elzody