Skip to content

Commit

Permalink
Renamed messaging to chat
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebires committed Mar 28, 2022
1 parent 3ec792a commit e1c776f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions messaging/messaging.go → chat/chat.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package messaging
package chat

import "github.com/takenet/lime-go"

func RegisterMessagingDocuments() {
func RegisterChatDocuments() {
lime.RegisterDocumentFactory(func() lime.Document {
return &Account{}
})
Expand Down
23 changes: 19 additions & 4 deletions messaging/resources.go → chat/resources.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package messaging
package chat

import (
"github.com/takenet/lime-go"
Expand Down Expand Up @@ -160,10 +160,10 @@ func (p *Presence) MediaType() lime.MediaType {
type PresenceStatus string

const (
// PresenceStatusUnavailable indicates that the node is not available for messaging and should not receive any
// PresenceStatusUnavailable indicates that the node is not available for chat and should not receive any
// envelope by any node, except by the connected server.
PresenceStatusUnavailable = PresenceStatus("unavailable")
// PresenceStatusAvailable indicates that the node is available for messaging and envelopes can be routed to the
// PresenceStatusAvailable indicates that the node is available for chat and envelopes can be routed to the
// node according to the defined routing rule.
PresenceStatusAvailable = PresenceStatus("available")
// PresenceStatusBusy indicates that the node is available but the senders should notice that it is busy and doesn't
Expand All @@ -172,7 +172,7 @@ const (
// PresenceStatusAway indicates that the node is available but the senders should notice that it may not be reading
// or processing the received envelopes.
PresenceStatusAway = PresenceStatus("away")
// PresenceStatusInvisible indicates that the node is available for messaging but the actual stored presence value
// PresenceStatusInvisible indicates that the node is available for chat but the actual stored presence value
// is unavailable.
PresenceStatusInvisible = PresenceStatus("invisible")
)
Expand All @@ -197,3 +197,18 @@ const (
// This rule is intended to be used only by sessions authenticated with DomainRole value as DomainRoleRootAuthority.
RoutingRuleRootDomain = RoutingRule("rootDomain")
)

// Ping allows the nodes to test the network connectivity.
type Ping struct{}

func MediaTypePing() lime.MediaType {
return lime.MediaType{
Type: "application",
Subtype: "vnd.lime.ping",
Suffix: "json",
}
}

func (p *Ping) MediaType() lime.MediaType {
return MediaTypePing()
}

0 comments on commit e1c776f

Please sign in to comment.