(P) server¶
(M) ChatApiABC¶
-
class
peek_plugin_chat.server.ChatApiABC.
ChatApiABC
[source]¶ Bases:
object
-
createChat
(fromExtUserId: str, toUserIds: List[str]) → None[source]¶ Create a Chat
Send a new chat message to a user.
Parameters: - fromExtUserId – The external userId sending the message
- toUserIds – The Peek userIds to send the message to
-
receiveMessages
(toExtUserId: str) → rx.subjects.subject.Subject[source]¶ Receive Messages
Get the observable that will be fired when new messages are received.
It will be fired with C{ReceivedMessage}
Parameters: toExtUserId – The external systems userId, that the plugin wants to observe messages for. This is just identifier unique to the external system. Returns: A RxJS Observable that will notify observers when a message arrives for that external system.
-
-
class
peek_plugin_chat.server.ChatApiABC.
NewMessage
(fromExtUserId: str, fromExtUserName: str, toUsers: List[peek_plugin_chat.server.ChatApiABC.NewMessageUser], message: str, priority: int = 2)[source]¶ Bases:
object
New Message
This class represents a new message that another plugin can send to a user.
Parameters: - fromExtUserId – The external user id of the user sending the message. This doesn’t have to match a userId in the peek_core_user plugin.
- fromExtUserName – The name of the external user (or system) sending the message.
- toUsers – A list of users to send the message to.
- message – The message to send to the user.
- priority – The priority of this message, some messages may be emergency messages.
-
PRIORITY_EMERGENCY
= 1¶ Emergency priority for message
-
PRIORITY_NORMAL_FLEETING
= 2¶ Normal priority for a message, the alert will be fleeting
-
PRIORITY_NORMAL_STICKY
= 3¶ Normal priority for message, the alert will be sticky
-
class
peek_plugin_chat.server.ChatApiABC.
NewMessageUser
(toUserId: str, onReadPayload: Optional[bytes] = None, onDeliveredPayload: Optional[bytes] = None)[source]¶ Bases:
object
New Message User
This class represents a user that the message will be sent to.
Parameters: - toUserId – The peek userId that matches a user in peek_core_user plugin.
- onReadPayload – (Optional) The payload that will be delivered locally on Peek Server when the user has read the message.
-
onDeliveredPayload
= None¶ On Delivered Payload
-
class
peek_plugin_chat.server.ChatApiABC.
ReceivedMessage
(fromUserId: str, allUserIds: List[str], message: str, priority: int)[source]¶ Bases:
object
Received Message
This class represents a message sent from a peek user to an external system.
Parameters: - fromUserId – The peek userId sending the message.
- allUserIds – All the userIds in this chat.
- message – The message sent by the peek user.
- priority – The priority of this message sent.
-
PRIORITY_EMERGENCY
= 1¶
-
PRIORITY_NORMAL_FLEETING
= 2¶
-
PRIORITY_NORMAL_STICKY
= 3¶