Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
chat-engine-event-status
Advanced tools
Adds the ability of tracking each message into different stages: (sent, delivery and read)
Adds the ability of tracking each message into different stages: (sent, delivery and read)
const ChatEngine = ChatEngineCore.create({
publishKey: 'pub-key-here',
subscribeKey: 'sub-key-here',
}, {
endpoint: 'http://chatengine:server/',
globalChannel: 'global-channel-name'
});
ChatEngine.connect('Username');
ChatEngine.on('$.ready', () => { ... });
const status = require('chat-engine-event-status');
chat.plugin(status({ event: 'message' }));
let sent = [];
//gets the tracking id of the new message sent
chat.on('$.eventStatus.sent', (payload) => {
const { data } = payload;
sent.push(data.id);
});
//synchronizes the message received into the stream with the tracking id got from event $.eventStatus.sent
let messages = [];
chat.on('message', (payload) => {
const index = this.sent.indexOf(payload.eventStatus.id);
if (index >= 0) {
payload.eventStatus.sent = true;
sent.splice(index, 1);
}
messages.push(payload);
});
In this way you can display into the screen that the message was sent using a check mark or whatever UI strategy.
chat.on('$.eventStatus.delivered', (payload) => {
let message = messages.find(w => w.eventStatus.id === payload.data.id);
if (message) {
message.eventStatus.delivery = true;
}
});
chat.eventStatus.read function receives as payload the message which has been read from the other side, in this point you can use different strategies to mark the message as read e.g. using the scroll down or when the list is focused.
chat.on('message', (payload) => {
chat.eventStatus.read(payload);
});
chat.on('$.eventStatus.read', (payload) => {
let message = this.messages.find(w => w.eventStatus.id === payload.data.id);
if (message) {
message.eventStatus.read = true;
}
});
Every payload returns field sender with which you can retrieve who user has notified the delivery or reading.
FAQs
Adds the ability of tracking each message into different stages: (sent, delivery and read)
The npm package chat-engine-event-status receives a total of 0 weekly downloads. As such, chat-engine-event-status popularity was classified as not popular.
We found that chat-engine-event-status demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.