Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Distinguish name and id for contact information #459

Open
phorcys420 opened this issue Mar 27, 2023 · 4 comments
Open

Distinguish name and id for contact information #459

phorcys420 opened this issue Mar 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@phorcys420
Copy link

phorcys420 commented Mar 27, 2023

If I take the example of Discord, I'd rather be able to have a label that says "user#0000", or "Discord" than a raw ID like that.

image

what I'm thinking about is that when creating the contact information type, you could specify whether you should distinguish ID and name or not. (and if #458 gets implemented, then two separate values should be available too)

@djaiss djaiss added the enhancement New feature or request label Apr 15, 2023
@phorcys420
Copy link
Author

I want to add that this'd be nice to have if monica plugins ever become a thing (or already are).

That way we could write plugins that would automatically integrate remote platforms with monica.

@djaiss
Copy link
Member

djaiss commented Apr 26, 2023

I want to add that this'd be nice to have if monica plugins ever become a thing (or already are).

I would love that. That being said, I have no idea how to achieve this. Do you know any kind of documentation I could read that would guide us towards this approach?

@phorcys420
Copy link
Author

phorcys420 commented Apr 27, 2023

I would love that. That being said, I have no idea how to achieve this. Do you know any kind of documentation I could read that would guide us towards this approach?

I'm more of a JS guy -- but generally speaking you'd source other PHP files from another directory.
In that plugin's directory, you usually have :

  • a config file
  • a dependencies file (in this case I assume it'd be a composer.json file)
  • a php file that exposes an init and other functions (usually related to hooks)
  • for efficiency you expose hooks for specific actions, that way the plugin only gets poked when needed.

Roundcube does it pretty well and uses composer for fetching the plugins but I'm unsure how they go about the whole hooks and API things since I've only ever done that type of stuff in JS.
https://github.com/roundcube/roundcubemail/wiki/Plugin-API

It seems that they do the loading by using an array in the config and (speculation) looping over it to source the proper files.

I havent found any good docs on php module systems, but I think roundcube's way of approaching it is the way to go.

I would start this out with basic plugin loading and exposing a high-level API for plugins to use (create user, edit user, etc) rather than immediately trying to implement hooks, since that's going to take a bit more time and the plugin system should be polished before.

I hope this helps.

@djaiss
Copy link
Member

djaiss commented May 5, 2023

@phorcys420 this is extremely instructive. Thanks a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants