messenger ⇒ WeavyWidget.plugins.messenger

Plugin for handling the Weavy Messenger. It also adds the messenger to the dock and displays unread conversations.

Kind: global mixin
Example
if (widget.plugins.messenger) {
    widget.open("messenger");
}

Instance members

widget.nodes ⇐ nodes

The nodes placeholder in WeavyWidget

Kind: instance property of messenger
Extends: nodes

widget.nodes.messengerPanel : Element

The panel for messenger

Kind: instance property of nodes

widget.nodes.messengerFrame : Element

The frame used by messengerPanel

Kind: instance property of nodes

widget.nodes.messengerButtonContainer : Element

The dock button container for messenger

Kind: instance property of nodes

widget.nodes.messengerButton : Element

The actual button in the messengerButtonContainer

Kind: instance property of nodes

widget.nodes.conversations : Element

Container for unread conversations. Appended to the messengerButton

Kind: instance property of nodes

widget.unreadConversations : Array.<Conversation>

List of unread conversations

Kind: instance property of messenger
Catergory: properties

widget.openConversation(conversationId, [event])

Open a conversation

Kind: instance method of messenger
ParamTypeDescription
conversationIdint

The id of the Conversation to open.

[event]Event

Optional event that will be prevented and propagation stopped


Events

"conversation-read" ⇒ Object

Triggered when conversation read data is received from the server.

Kind: event emitted by messenger
Category: events
Properties
NameType
userUser
conversationConversation

"message-inserted" ⇒ Message

Triggered when a message is appended in a conversation.

Kind: event emitted by messenger
Category: events

Static members

messenger.defaults : Object

Default plugin options

Kind: static property of messenger
Properties
NameTypeDefaultDescription
iconhtml

Icon for the messenger button

iconTransparentbool true

Transparency setting for the messenger button

panelIdstring "messenger"

Default name for the messenger panel

Example
WeavyWidget.plugins.messenger.defaults = {
    icon: '
', iconTransparent: true, panelId: "messenger" };

messenger.dependencies : Array.<string>

Non-optional dependencies.

Kind: static property of messenger

Inner members

messenger~User : Object

Kind: inner typedef of messenger
Properties
NameTypeDescription
idint

The id of the user

namestring

The name of the user

thumbUrlurl

Url to the user avatar

typestring

"user"

urlurl

Url to the user profile

usernamestring

The username used for mentions etc.


messenger~Conversation : Object

Kind: inner typedef of messenger
Properties
NameTypeDescription
createdAtISODateTime

The time the conversation started

createdByUser

The user that created the conversation

deliveredAtISODateTime

When the last message was delivered

descriptionstring

Snippet of the most recent message in the conversation

followedByArray.<int>

List of ids of the users that follow the conversation.

iconObject

A Material Design Icon that is suitable for display of the conversation.

icon.namestring

The name of the icon.

icon.colorstring

The icon color name.

idint

The id of the conversation

isMemberboolean

Is the user a member in the converation

isReadboolean

Is all messages read by the user

isRoomboolean

Is the conversation a room

kindstring

"conversation"

lastMessageAtISODateTime

The time the last message was sent

lastMessageByUser

The user that sent the last message

membersArray.<User>

All the uesers that is part of the conversation.

permissionsArray.<string>

List of permissions on the conversation for the current user.

readAtISODateTime

The time the current user viewed the conversation.

thumbUrlurl

The url to the avatar for the conversation.

typestring

"conversation"

urlurl

The url to the conversation


messenger~Message : Object

Kind: inner typedef of messenger
Properties
NameTypeDescription
idint

The id of the message

typestring

"message"

conversationint

Id of the conversation the message belongs to.

textstring

The message text.

htmlhtml

The message text as HTML.

createdAtISODateTime

The time the message was created.

createdByUser

The user that created the message

iconObject

A Material Design Icon that is suitable for display of the message.

icon.namestring

The name of the icon.

icon.colorstring

The icon color name.

kindstring

"message"

urlurl

The url to the message

thumbUrlurl

The url to the avatar for the message.

permissionsArray.<string>

List of permissions on the message for the current user.