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
a1c498cd
Commit
a1c498cd
authored
Jan 05, 2016
by
Tom Evans
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #473 from ishmakov/invitationrejection-delegate
MUC Invitation rejection delegate call
parents
736b76f1
71a639fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
MUCEventDelegate.java
src/java/org/jivesoftware/openfire/muc/MUCEventDelegate.java
+20
-2
LocalMUCRoom.java
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
+11
-0
No files found.
src/java/org/jivesoftware/openfire/muc/MUCEventDelegate.java
View file @
a1c498cd
...
...
@@ -34,8 +34,13 @@ public abstract class MUCEventDelegate {
public
enum
InvitationResult
{
HANDLED_BY_DELEGATE
,
HANDLED_BY_OPENFIRE
,
REJECTED
;
}
REJECTED
};
public
enum
InvitationRejectionResult
{
HANDLED_BY_DELEGATE
,
HANDLED_BY_OPENFIRE
,
};
/**
* This event will be triggered when an entity joins an existing room.
...
...
@@ -61,6 +66,19 @@ public abstract class MUCEventDelegate {
*/
public
abstract
InvitationResult
sendingInvitation
(
MUCRoom
room
,
JID
inviteeJID
,
JID
inviterJID
,
String
inviteMessage
);
/**
* This event will be triggered when an entity reject invite from someone to a room.
*
* Returns a String indicating whether the invitation should be abandoned, handled by the delegate, or handled by openfire.
*
* @param room the MUC room.
* @param to the JID of the user the rejecting of invitation will be sent to.
* @param from the JID of the user that is sending the rejecting of invitation
* @param reason the (optional) message that is sent explaining the rejection invitation
* @return true if the user is allowed to join the room.
*/
public
abstract
InvitationRejectionResult
sendingInvitationRejection
(
MUCRoom
room
,
JID
to
,
JID
from
,
String
reason
);
/**
* Returns a map containing room configuration variables and values.
*
...
...
src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java
View file @
a1c498cd
...
...
@@ -2115,6 +2115,17 @@ public class LocalMUCRoom implements MUCRoom, GroupEventListener {
@Override
public
void
sendInvitationRejection
(
JID
to
,
String
reason
,
JID
sender
)
{
if
(((
MultiUserChatServiceImpl
)
mucService
).
getMUCDelegate
()
!=
null
)
{
switch
(((
MultiUserChatServiceImpl
)
mucService
).
getMUCDelegate
().
sendingInvitationRejection
(
this
,
to
,
sender
,
reason
))
{
case
HANDLED_BY_DELEGATE:
//if the delegate is taking care of it, there's nothing for us to do
return
;
case
HANDLED_BY_OPENFIRE:
//continue as normal if we're asked to handle it
break
;
}
}
Message
message
=
new
Message
();
message
.
setFrom
(
role
.
getRoleAddress
());
message
.
setTo
(
to
);
...
...
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