Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/storytellercz/meteor-messaging-server
Publish functions for socialize:messaging
https://github.com/storytellercz/meteor-messaging-server
Last synced: 4 days ago
JSON representation
Publish functions for socialize:messaging
- Host: GitHub
- URL: https://github.com/storytellercz/meteor-messaging-server
- Owner: StorytellerCZ
- License: mit
- Created: 2016-03-05T15:06:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-13T17:12:31.000Z (11 months ago)
- Last Synced: 2024-10-16T20:59:58.710Z (29 days ago)
- Language: JavaScript
- Homepage: https://atmospherejs.com/storyteller/messaging-server
- Size: 31.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# storyteller:messaging-server
Additional server functionality for `socialize:messaging`.
## How to use
On your server import and call the following to your methods and publications:
```javascript
import { messagingPublications } from 'meteor/storyteller:messaging-server';
messagingPublications();import { messagingPublications } from 'meteor/storyteller:messaging-server';
messagingPublications();
```## Publications
### `pm.users.search`
**Params:**
* query {String} - Search query, usually part of a user's username
* excluded {Array} - Array of ids of users that should be excluded from the searchReturns search results of a query against the users collection.
### `pm.conversation`
**Params:**
* conversationId {String} - id of the requested conversationWill return conversation with the info on participants and last message.
### `pm.conversations`
**Params:**
* options {Object} - object containing `limit` and `skip` propertiesReturn conversations that the user is a participant in.
### `pm.conversations.unread`
Returns all the conversations that the user has some unread messages in.
### `pm.messages.for`
**Params:**
* conversationId {String} - conversation id
* options {object} - object containing `limit` and `skip` propertiesGet messages in the given range for the given conversation.
## Methods
### `pm.conversation.count`
**Params:**
* conversationId {String} - id of the conversationCounts total number of messages in a given conversation.
### `pm.conversation.new`
**Params:**
* to {Array} - Array of the users to send message to
* message {String} - Text of the messageCreates a new conversation to the given user with the given message. If a conversation already exists between the current user and the given users it will append the message to the already existing conversation instead of creating a new one.