Skip to content

Modifications in Rocket.chat codebase

Shubham Singh edited this page Aug 13, 2019 · 3 revisions

Articles package

app/articles contains the server-side modification code to integrate Ghost in Rocket.chat.

Files Added

  1. app/articles/server/api/api.js
    Restivus for creating incoming callbacks for announcing post for published articles. Announcement token is used to verify the callbacks from the correct server(similar to the incoming callback in RC). [processWebhookMessage](https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/functions/processWebhookMessage.js) is used to send message in the announcing room with the message received from Ghost server.

  2. app/articles/server/methods/admin.js
    Meteor method used to set-up Ghost and navigate to admin panel of Ghost.

  3. app/articles/server/methods/user.js
    Meteor functions:

  • redirectUserToArticles: To redirect the user if he/she is a member of Ghost. If not a member, try to create an account and then redirect.
  • redirectToUsersArticles: To redirect to user's articles page where all the public published articles can be viewed.
  1. app/articles/server/lib/triggerHandler.js

(Maybe deprecated)

Similar to the outgoing triggerHandler Outgoing callback is implemented which keep in sync the user deletion.

  1. app/articles/server/logoutCleanUp.js
    To ensure that the ghost session is deleted after user logout from the RC.

  2. app/articles/server/settings.js
    Add setting fields for articles in admin panel.

  3. app/articles/server/utils/ghostAPI.js
    Class to interact with ghost API to create user, setup ghost, and executetrigger Url for outgoing callbacks.

  4. app/discussion/server/methods/createDiscussion.js
    Added a t parameter in API call which allows to create public discussion using API call.

Clone this wiki locally