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
7f084676
Commit
7f084676
authored
Aug 16, 2016
by
Dave Cridland
Committed by
GitHub
Aug 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #634 from guusdk/OF-1174_muc_iq_response
OF-1174: MUC should always respond to IQ requests.
parents
e8cc92f4
0aab9098
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
19 deletions
+41
-19
LocalMUCUser.java
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCUser.java
+17
-10
MultiUserChatServiceImpl.java
...vesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java
+24
-9
No files found.
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCUser.java
View file @
7f084676
...
@@ -29,6 +29,7 @@ import java.util.Map;
...
@@ -29,6 +29,7 @@ import java.util.Map;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
org.dom4j.Element
;
import
org.dom4j.Element
;
import
org.dom4j.QName
;
import
org.jivesoftware.openfire.PacketException
;
import
org.jivesoftware.openfire.PacketException
;
import
org.jivesoftware.openfire.PacketRouter
;
import
org.jivesoftware.openfire.PacketRouter
;
import
org.jivesoftware.openfire.auth.UnauthorizedException
;
import
org.jivesoftware.openfire.auth.UnauthorizedException
;
...
@@ -223,10 +224,8 @@ public class LocalMUCUser implements MUCUser {
...
@@ -223,10 +224,8 @@ public class LocalMUCUser implements MUCUser {
JID
recipient
=
packet
.
getTo
();
JID
recipient
=
packet
.
getTo
();
String
group
=
recipient
.
getNode
();
String
group
=
recipient
.
getNode
();
if
(
group
==
null
)
{
if
(
group
==
null
)
{
// Ignore packets to the groupchat server
// Packets to the groupchat server. This should not occur (should be handled by MultiUserChatServiceImpl instead)
// In the future, we'll need to support TYPE_IQ queries to the server for MUC
Log
.
warn
(
LocaleUtils
.
getLocalizedString
(
"muc.error.not-supported"
)
+
" "
+
packet
.
toString
()
);
Log
.
info
(
LocaleUtils
.
getLocalizedString
(
"muc.error.not-supported"
)
+
" "
+
packet
.
toString
());
}
}
else
{
else
{
MUCRole
role
=
roles
.
get
(
group
);
MUCRole
role
=
roles
.
get
(
group
);
...
@@ -371,13 +370,18 @@ public class LocalMUCUser implements MUCUser {
...
@@ -371,13 +370,18 @@ public class LocalMUCUser implements MUCUser {
lastPacketTime
=
System
.
currentTimeMillis
();
lastPacketTime
=
System
.
currentTimeMillis
();
JID
recipient
=
packet
.
getTo
();
JID
recipient
=
packet
.
getTo
();
String
group
=
recipient
.
getNode
();
String
group
=
recipient
.
getNode
();
if
(
group
==
null
)
{
if
(
group
==
null
)
// Ignore packets to the groupchat server
{
// In the future, we'll need to support TYPE_IQ queries to the server for MUC
// Packets to the groupchat server. This should not occur (should be handled by MultiUserChatServiceImpl instead)
Log
.
info
(
LocaleUtils
.
getLocalizedString
(
"muc.error.not-supported"
)
+
" "
if
(
packet
.
isRequest
()
)
+
packet
.
toString
());
{
sendErrorPacket
(
packet
,
PacketError
.
Condition
.
feature_not_implemented
);
}
Log
.
warn
(
LocaleUtils
.
getLocalizedString
(
"muc.error.not-supported"
)
+
" "
+
packet
.
toString
()
);
}
}
else
{
else
{
// Packets to a specific node/group/room
MUCRole
role
=
roles
.
get
(
group
);
MUCRole
role
=
roles
.
get
(
group
);
if
(
role
==
null
)
{
if
(
role
==
null
)
{
// If a non-occupant sends a disco to an address of the form <room@service/nick>,
// If a non-occupant sends a disco to an address of the form <room@service/nick>,
...
@@ -599,6 +603,9 @@ public class LocalMUCUser implements MUCUser {
...
@@ -599,6 +603,9 @@ public class LocalMUCUser implements MUCUser {
}
}
}
}
}
}
}
else
{
// Packets to the groupchat server. This should not occur (should be handled by MultiUserChatServiceImpl instead)
Log
.
warn
(
LocaleUtils
.
getLocalizedString
(
"muc.error.not-supported"
)
+
" "
+
packet
.
toString
()
);
}
}
}
}
...
...
src/java/org/jivesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java
View file @
7f084676
...
@@ -80,11 +80,7 @@ import org.xmpp.component.ComponentManager;
...
@@ -80,11 +80,7 @@ import org.xmpp.component.ComponentManager;
import
org.xmpp.forms.DataForm
;
import
org.xmpp.forms.DataForm
;
import
org.xmpp.forms.DataForm.Type
;
import
org.xmpp.forms.DataForm.Type
;
import
org.xmpp.forms.FormField
;
import
org.xmpp.forms.FormField
;
import
org.xmpp.packet.IQ
;
import
org.xmpp.packet.*
;
import
org.xmpp.packet.JID
;
import
org.xmpp.packet.Message
;
import
org.xmpp.packet.Packet
;
import
org.xmpp.packet.Presence
;
import
org.xmpp.resultsetmanagement.ResultSet
;
import
org.xmpp.resultsetmanagement.ResultSet
;
/**
/**
...
@@ -335,10 +331,26 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
...
@@ -335,10 +331,26 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
return
;
return
;
}
}
}
}
// The packet is a normal packet that should possibly be sent to the room
JID
recipient
=
packet
.
getTo
();
if
(
packet
.
getTo
().
getNode
()
==
null
)
String
roomName
=
recipient
!=
null
?
recipient
.
getNode
()
:
null
;
{
getChatUser
(
packet
.
getFrom
(),
roomName
).
process
(
packet
);
// This was addressed at the service itself, which by now should have been handled.
if
(
packet
instanceof
IQ
&&
((
IQ
)
packet
).
isRequest
()
)
{
final
IQ
reply
=
IQ
.
createResultIQ
(
(
IQ
)
packet
);
reply
.
setChildElement
(
((
IQ
)
packet
).
getChildElement
().
createCopy
()
);
reply
.
setError
(
PacketError
.
Condition
.
feature_not_implemented
);
router
.
route
(
reply
);
}
Log
.
debug
(
"Ignoring stanza addressed at conference service: {}"
,
packet
.
toXML
()
);
}
else
{
// The packet is a normal packet that should possibly be sent to the room
JID
recipient
=
packet
.
getTo
();
String
roomName
=
recipient
!=
null
?
recipient
.
getNode
()
:
null
;
getChatUser
(
packet
.
getFrom
(),
roomName
).
process
(
packet
);
}
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
Log
.
error
(
LocaleUtils
.
getLocalizedString
(
"admin.error"
),
e
);
Log
.
error
(
LocaleUtils
.
getLocalizedString
(
"admin.error"
),
e
);
...
@@ -386,6 +398,9 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
...
@@ -386,6 +398,9 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
IQ
reply
=
XMPPServer
.
getInstance
().
getIQDiscoItemsHandler
().
handleIQ
(
iq
);
IQ
reply
=
XMPPServer
.
getInstance
().
getIQDiscoItemsHandler
().
handleIQ
(
iq
);
router
.
route
(
reply
);
router
.
route
(
reply
);
}
}
else
if
(
"urn:xmpp:ping"
.
equals
(
namespace
))
{
router
.
route
(
IQ
.
createResultIQ
(
iq
)
);
}
else
{
else
{
return
false
;
return
false
;
}
}
...
...
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