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
ca44c1f7
Commit
ca44c1f7
authored
Feb 03, 2018
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1472: Add basic support for XEP-0157.
parent
f961503d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
IQDiscoInfoHandler.java
...a/org/jivesoftware/openfire/disco/IQDiscoInfoHandler.java
+45
-0
No files found.
src/java/org/jivesoftware/openfire/disco/IQDiscoInfoHandler.java
View file @
ca44c1f7
...
...
@@ -32,6 +32,7 @@ import org.jivesoftware.util.JiveGlobals;
import
org.jivesoftware.util.cache.Cache
;
import
org.jivesoftware.util.cache.CacheFactory
;
import
org.xmpp.forms.DataForm
;
import
org.xmpp.forms.FormField
;
import
org.xmpp.packet.IQ
;
import
org.xmpp.packet.JID
;
import
org.xmpp.packet.PacketError
;
...
...
@@ -508,6 +509,50 @@ public class IQDiscoInfoHandler extends IQHandler implements ClusterEventListene
// Redirect the request to the disco info provider of the specified node
return
serverNodeProviders
.
get
(
node
).
getExtendedInfo
(
name
,
node
,
senderJID
);
}
if
(
name
==
null
||
name
.
equals
(
XMPPServer
.
getInstance
().
getServerInfo
().
getXMPPDomain
()))
{
// Answer extended info of the server itself.
// XEP-0157 Contact addresses for XMPP Services
if
(
!
JiveGlobals
.
getBooleanProperty
(
"admin.disable-exposure"
)
)
{
final
Collection
<
JID
>
admins
=
XMPPServer
.
getInstance
().
getAdmins
();
if
(
admins
==
null
||
admins
.
isEmpty
()
)
{
return
null
;
}
final
DataForm
dataForm
=
new
DataForm
(
DataForm
.
Type
.
result
);
final
FormField
fieldType
=
dataForm
.
addField
();
fieldType
.
setVariable
(
"FORM_TYPE"
);
fieldType
.
setType
(
FormField
.
Type
.
hidden
);
fieldType
.
addValue
(
"http://jabber.org/network/serverinfo"
);
final
FormField
fieldAdminAddresses
=
dataForm
.
addField
();
fieldAdminAddresses
.
setVariable
(
"admin-addresses"
);
final
UserManager
userManager
=
UserManager
.
getInstance
();
for
(
final
JID
admin
:
admins
)
{
fieldAdminAddresses
.
addValue
(
"xmpp:"
+
admin
.
asBareJID
()
);
if
(
admin
.
getDomain
().
equals
(
XMPPServer
.
getInstance
().
getServerInfo
().
getXMPPDomain
()
)
)
try
{
final
String
email
=
userManager
.
getUser
(
admin
.
getNode
()
).
getEmail
();
if
(
email
!=
null
&&
!
email
.
trim
().
isEmpty
()
)
{
fieldAdminAddresses
.
addValue
(
"mailto:"
+
email
);
}
}
catch
(
Exception
e
)
{
continue
;
}
}
return
dataForm
;
}
}
if
(
node
!=
null
&&
name
!=
null
)
{
return
XMPPServer
.
getInstance
().
getIQPEPHandler
().
getExtendedInfo
(
name
,
node
,
senderJID
);
}
...
...
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