Integration of chat module - need permanent users table and creating a cookie

Hi everybody,

I would like to integrate a specific chat module on my nextcloud but it required I modify Nextcloud to work with permanent users table which stores users information permanently.

I sent a message to the module developer and he replied:

"Please go through below steps and details and do the necessary changes from your server. Unless and until the below steps are performed we will not be able to proceed with the installation as in your database there is no permanent users table which stores users information permanently.

In the “oc_authtoken” table, a new record with new id is created every time a user logs in and the same record is deleted when the user logs out of the site. The id does not remain constant for a particular user. Whereas, CometChat requires a fixed unique id for every user.

​STEPS:​

We request you to create a cookie named “cc_data” every time a user logs into the site and destroy it when a user logs out. The cookie must contain the following details of a particular user:

  1. Username
  2. Display name
  3. Avatar link
  4. User profile link
  5. E-mail (if any)

Also, please ensure that the cookie created “cc_data” is in base64 encrypted format.

Cookie Format Example:

cc_base = {‘id’:chat_id,‘n’:chat_name,‘a’:chat_avatar,‘l’:chat_link};
document.cookie = ‘cc_data=’+base64_encode(JSON.stringify(cc_base))+’;path=/;’;
"

I understand roughly what it means but I am not able to make its modifications and I purify to do anything …

Could someone guide me?

We already have a chat client: https://apps.nextcloud.com/apps/ojsxc
There was a different app which is no longer maintained: https://github.com/owncloudarchive/chat

In general, there are not so many developers so it is better to join forces and don’t develop similar apps.