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
60141ddf
Commit
60141ddf
authored
May 13, 2014
by
Christian Schudt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-803 Message Carbons may throw org.dom4j.IllegalAddException, resulting in disconnection
parent
6e102ccf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
Forwarded.java
src/java/org/jivesoftware/openfire/forward/Forwarded.java
+5
-4
ForwardTest.java
...t/java/org/jivesoftware/openfire/forward/ForwardTest.java
+5
-2
No files found.
src/java/org/jivesoftware/openfire/forward/Forwarded.java
View file @
60141ddf
...
@@ -12,15 +12,16 @@ public class Forwarded extends PacketExtension {
...
@@ -12,15 +12,16 @@ public class Forwarded extends PacketExtension {
public
Forwarded
(
Message
message
)
{
public
Forwarded
(
Message
message
)
{
super
(
"forwarded"
,
"urn:xmpp:forward:0"
);
super
(
"forwarded"
,
"urn:xmpp:forward:0"
);
message
.
getElement
().
setQName
(
QName
.
get
(
"message"
,
"jabber:client"
)
);
Message
copy
=
message
.
createCopy
(
);
for
(
Object
element
:
message
.
getElement
().
elements
())
{
copy
.
getElement
().
setQName
(
QName
.
get
(
"message"
,
"jabber:client"
));
for
(
Object
element
:
copy
.
getElement
().
elements
())
{
if
(
element
instanceof
Element
)
{
if
(
element
instanceof
Element
)
{
Element
el
=
(
Element
)
element
;
Element
el
=
(
Element
)
element
;
el
.
setQName
(
QName
.
get
(
el
.
getName
(),
"jabber:client"
));
el
.
setQName
(
QName
.
get
(
el
.
getName
(),
"jabber:client"
));
}
}
}
}
element
.
add
(
copy
.
getElement
());
element
.
add
(
message
.
getElement
());
}
}
}
}
src/test/java/org/jivesoftware/openfire/forward/ForwardTest.java
View file @
60141ddf
...
@@ -17,7 +17,10 @@ public class ForwardTest {
...
@@ -17,7 +17,10 @@ public class ForwardTest {
message
.
setBody
(
"Tests"
);
message
.
setBody
(
"Tests"
);
Forwarded
forwarded
=
new
Forwarded
(
message
);
Forwarded
forwarded
=
new
Forwarded
(
message
);
String
xml
=
forwarded
.
getElement
().
asXML
();
Forwarded
forwarded2
=
new
Forwarded
(
message
);
assertEquals
(
"<forwarded xmlns=\"urn:xmpp:forward:0\"><message xmlns=\"jabber:client\" type=\"chat\"><body>Tests</body></message></forwarded>"
,
xml
);
String
xml1
=
forwarded
.
getElement
().
asXML
();
String
xml2
=
forwarded2
.
getElement
().
asXML
();
assertEquals
(
"<forwarded xmlns=\"urn:xmpp:forward:0\"><message xmlns=\"jabber:client\" type=\"chat\"><body>Tests</body></message></forwarded>"
,
xml1
);
assertEquals
(
"<forwarded xmlns=\"urn:xmpp:forward:0\"><message xmlns=\"jabber:client\" type=\"chat\"><body>Tests</body></message></forwarded>"
,
xml2
);
}
}
}
}
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