Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
237cf9c4
Commit
237cf9c4
authored
May 21, 2014
by
Christian Schudt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-810 RFC 6121 Routing Compliance Fix
parent
a811a1f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
MessageRouter.java
src/java/org/jivesoftware/openfire/MessageRouter.java
+4
-1
OfflineMessageStrategy.java
...ava/org/jivesoftware/openfire/OfflineMessageStrategy.java
+35
-8
No files found.
src/java/org/jivesoftware/openfire/MessageRouter.java
View file @
237cf9c4
...
...
@@ -250,7 +250,10 @@ public class MessageRouter extends BasicModule {
// If message was sent to an unavailable full JID of a user then retry using the bare JID
if
(
serverName
.
equals
(
recipient
.
getDomain
())
&&
recipient
.
getResource
()
!=
null
&&
userManager
.
isRegisteredUser
(
recipient
.
getNode
()))
{
Message
msg
=
(
Message
)
packet
;
if
(
msg
.
getType
().
equals
(
Message
.
Type
.
chat
))
{
routingTable
.
routePacket
(
recipient
.
asBareJID
(),
packet
,
false
);
}
}
else
{
// Just store the message offline
messageStrategy
.
storeOffline
((
Message
)
packet
);
...
...
src/java/org/jivesoftware/openfire/OfflineMessageStrategy.java
View file @
237cf9c4
...
...
@@ -86,12 +86,7 @@ public class OfflineMessageStrategy extends BasicModule {
!
UserManager
.
getInstance
().
isRegisteredUser
(
recipientJID
.
getNode
()))
{
return
;
}
// Do not store messages of type groupchat, error or headline as specified in JEP-160
if
(
Message
.
Type
.
groupchat
==
message
.
getType
()
||
Message
.
Type
.
error
==
message
.
getType
()
||
Message
.
Type
.
headline
==
message
.
getType
())
{
return
;
}
// Do not store messages if communication is blocked
PrivacyList
list
=
PrivacyListManager
.
getInstance
().
getDefaultPrivacyList
(
recipientJID
.
getNode
());
...
...
@@ -103,6 +98,38 @@ public class OfflineMessageStrategy extends BasicModule {
return
;
}
// 8.5.2. localpart@domainpart
// 8.5.2.2. No Available or Connected Resources
if
(
recipientJID
.
getResource
()
==
null
)
{
if
(
message
.
getType
()
==
Message
.
Type
.
headline
||
message
.
getType
()
==
Message
.
Type
.
error
)
{
// For a message stanza of type "headline" or "error", the server MUST silently ignore the message.
return
;
}
// // For a message stanza of type "groupchat", the server MUST return an error to the sender, which SHOULD be <service-unavailable/>.
else
if
(
message
.
getType
()
==
Message
.
Type
.
groupchat
)
{
bounce
(
message
);
return
;
}
}
else
{
// 8.5.3. localpart@domainpart/resourcepart
// 8.5.3.2.1. Message
// For a message stanza of type "normal", "groupchat", or "headline", the server MUST either (a) silently ignore the stanza
// or (b) return an error stanza to the sender, which SHOULD be <service-unavailable/>.
if
(
message
.
getType
()
==
Message
.
Type
.
normal
||
message
.
getType
()
==
Message
.
Type
.
groupchat
||
message
.
getType
()
==
Message
.
Type
.
headline
)
{
if
(
type
==
Type
.
bounce
)
{
bounce
(
message
);
}
else
{
return
;
}
}
// For a message stanza of type "error", the server MUST silently ignore the stanza.
else
if
(
message
.
getType
()
==
Message
.
Type
.
error
)
{
// For a message stanza of type "error", the server MUST silently ignore the stanza.
return
;
}
}
if
(
type
==
Type
.
bounce
)
{
bounce
(
message
);
}
...
...
@@ -168,8 +195,8 @@ public class OfflineMessageStrategy extends BasicModule {
try
{
// Generate a rejection response to the sender
Message
errorResponse
=
message
.
createCopy
();
errorResponse
.
setError
(
new
PacketError
(
PacketError
.
Condition
.
item_not_found
,
PacketError
.
Type
.
continue_processing
)
);
// return an error stanza to the sender, which SHOULD be <service-unavailable/>
errorResponse
.
setError
(
PacketError
.
Condition
.
service_unavailable
);
errorResponse
.
setFrom
(
message
.
getTo
());
errorResponse
.
setTo
(
message
.
getFrom
());
// Send the response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment