-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partial support for XEP-0249 Direct MUC Invitations #535
Add partial support for XEP-0249 Direct MUC Invitations #535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I have left some remarks inline.
I think the most important issue that this is currently somehow entangled with some arbitrary MultiUserChat
instance, when its business logic should really go into a new class DirectMucInviteManager
.
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
Bumping BC is fine. Since you give not details why you couldn't build without updating, I can't really help you there. |
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
final MUCUser.Invite mucInvite = null; | ||
final EntityJid from = message.getFrom().asEntityJidIfPossible(); | ||
if (from == null) { | ||
LOGGER.warning("Group Chat Invitation from non entity JID: '" + message.toXML() + "'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not super happy about that, as I believe it is likely that components, i.e., domain bare JIDs, could also send directed invites. I think we could change the signature of InvitationsLIstener
to use just Jid
for inviter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree. The end user the invitation is from should be the same regardless of if they're using an XEP-0249 direct invitation or a mediated XEP-0045 invitation. If we are asserting a user must be an entity jid in the XEP-0045 case then I think it's very reasonable to assert the same here.
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if you re-invented org.jivesoftware.util.Protocol
with InvokeDirectlyResponder
in your tests (or similar already existing classes of Smack's test fixtures). Please check that you don't invent the wheel again, I wouldn't be surprised if Smack wouldn't already provide what you need for the tests. Unfortunately, I had no time to dig into this further.
smack-core/src/testFixtures/java/org/jivesoftware/smack/test/util/WaitForPacketListener.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitation.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitation.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitation.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitation.java
Outdated
Show resolved
Hide resolved
smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java
Outdated
Show resolved
Hide resolved
I think these are suitably disparate.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only one minor thing, then this is ready to go.
Please
- squash the commits into one
- Add an table row for xep249 to
Smack/smack-java8-full/src/main/java/org/jivesoftware/smackx/package-info.java
Lines 348 to 361 in f6c85d9
* <tr> * <td>Roster Versioning</td> * <td><a href="https://xmpp.org/extensions/xep-0237.html">XEP-0237</a></td> * <td></td> * <td>Efficient roster synchronization.</td> * </tr> * <tr> * <td>Message Carbons</td> * <td><a href="https://xmpp.org/extensions/xep-0280.html">XEP-0280</a></td> * <td>{@link org.jivesoftware.smackx.carbons}</td> * <td>Keep all IM clients for a user engaged in a conversation, by carbon-copy outbound messages to all interested * resources.</td> * </tr> * <tr> - rebase on the current master
- mention "Fixes SMACK-932" in the commit message's body. Also
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
Outdated
Show resolved
Hide resolved
e03c02a
to
75c6663
Compare
Should be good to merge now :) |
The commit message's subject currently reads "Fixes SMACK-932.". That is not really helpful if I look at a commit log only consisting of the commit subject. |
Exposes a method for a MUC to invite a user to the room, and adds a listener to the MultiUserChat listener to inform users of direct invitations they have received. Fixes SMACK-932.
75c6663
to
9e9c233
Compare
Ok, commit message re-arranged. |
This MR adds in partial support for XEP-0249 Direct MUC Invitations
It exposes a method for a MUC to invite a user to the room, and adds a listener to the MultiUserChat listener to inform users of direct invitations they have received.
A new UT class is added to test this function.
I found I could not build Smack without updating bouncy castle to 1.71 so have done so in this MR. Please advise how I would build without doing this if this is not desired.