+- idempotency_key: The copy of the `idempotency-key` HTTP request header that can be used for optimistic message sending. Included only during the first few minutes after the message creation.
+
### Posting a chat message
Posting a chat message for given Chat id works like this:
### Posting a chat message
Posting a chat message for given Chat id works like this:
-`POST /api/v1/pleroma/chats/{id}/messages`
+`POST /api/v1/pleroma/chats/:id/messages`
Parameters:
- content: The text content of the message. Optional if media is attached.
Parameters:
- content: The text content of the message. Optional if media is attached.
-There's a new `pleroma:chat_mention` notification, which has this form:
+There's a new `pleroma:chat_mention` notification, which has this form. It is not given out in the notifications endpoint by default, you need to explicitly request it with `include_types[]=pleroma:chat_mention`:
```json
{
```json
{
@@ -215,8+239,17 @@ There's a new `pleroma:chat_mention` notification, which has this form:
"chat_id": "1",
"id": "10",
"content": "Hello",
"chat_id": "1",
"id": "10",
"content": "Hello",
- "account_id": "someflakeid"
+ "account_id": "someflakeid",
+ "unread": false
},
"created_at": "somedate"
}
```
},
"created_at": "somedate"
}
```
+
+### Streaming
+
+There is an additional `user:pleroma_chat` stream. Incoming chat messages will make the current chat be sent to this `user` stream. The `event` of an incoming chat message is `pleroma:chat_update`. The payload is the updated chat with the incoming chat message in the `last_message` field.
+
+### Web Push
+
+If you want to receive push messages for this type, you'll need to add the `pleroma:chat_mention` type to your alerts in the push subscription.