Skip to content
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

Jingle and Jingle File Transfer #489

Closed
wants to merge 2 commits into from
Closed

Conversation

gkfabs
Copy link

@gkfabs gkfabs commented Sep 7, 2021

This PR adds initial support (elements and providers) for XEP-0166 and XEP-0234

I took the work from https://github.com/vanitasvitae/Smack/tree/jftPR and made the modifications to the new code base.

@gkfabs
Copy link
Author

gkfabs commented Oct 23, 2021

That would be great to have jingle file transfert to be able to send image files (camera, graph, etc...) to jabber client from openhab. What should I do to have a small review of the code quality ?

Thanks

@gkfabs gkfabs force-pushed the master branch 2 times, most recently from fb5152f to 58f7163 Compare October 27, 2021 17:25
@Flowdalic
Copy link
Member

What should I do to have a small review of the code quality ?

Sorry for the late response. My priority is to get the next Smack release out, but after that, I'll look at your code. Meanwhile, I have tirggered a CI run for this PR. Feel free to address any issues potentially found by the run.

@gkfabs
Copy link
Author

gkfabs commented Oct 28, 2021

Thanks you so much! I'll address the issues from the CI in the next 7 days.

@Flowdalic
Copy link
Member

Flowdalic commented Oct 28, 2021

Note that you can always run the checks locally via gradle check. I suggest doing so as part of your development cycle :)

@gkfabs
Copy link
Author

gkfabs commented Oct 28, 2021

On my local it is working without error

fabs@FabsLaptop:~/programme/Smack/smack-experimental (master)$ gradle check
Starting a Gradle Daemon (subsequent builds will be faster)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4m 0s
33 actionable tasks: 25 executed, 8 up-to-date

That must be a version problem of some kind. I'll find it.

Thanks

@Flowdalic
Copy link
Member

On my local it is working without error

fabs@FabsLaptop:~/programme/Smack/smack-experimental (master)$ gradle check

Run gradle check in Smack's root, not in a Smack subproject directory.

@gkfabs
Copy link
Author

gkfabs commented Oct 28, 2021

yes sorry I went to quickly over it. That should be the right one

fabs@FabsLaptop:~/programme/Smack (master)$ gradle check

> Task :smack-extensions:test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

> Task :smack-repl:scalaStyleMainCheck
Processed 1 file(s)
Found 0 warnings
Found 0 errors
Finished in 515 ms

> Task :smack-websocket:test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

> Task :smack-websocket-okhttp:test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 7m 2s
309 actionable tasks: 258 executed, 51 up-to-date

Copy link
Member

@Flowdalic Flowdalic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've stopped the review half though, since this appears to be a half baked pull request (why isn't it marked WIP?). I think, if you want to continue working on Jingle support, then the initial work should be done outside of the Smack repository. Create an extra library with your code, that pulls in Smack as dependency. And, once the code is ready, it can be donated back to Smack.

@@ -131,6 +131,9 @@ allprojects {
androidJavadocOffline = { getAndroidJavadocOffline() }
junit4Projects = [
':smack-core',
':smack-extensions',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to phase out junit 4 in favor of junit 5 in Smack, so please don't add more projects here.


/**
* Manager for JingleFileTransfer (XEP-0234).
* Manager for XEP-0234 - JingleFileTransfers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this was changed. I liked the old style more, as XEP numbers are less important than humand readable text. But the missing spaces should be added, after all, the title of the XEP is "Jingle File Transfer".


/**
* Class representing the base of a JingleFileRequest.
* TODO: Implement.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not implemented? Why is it here than?

break;
}
}
LOGGER.log(Level.FINE, "Reading/Writing finished.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those log statements are harmful. Especially when they only consist of a static string.


/**
* Backend logic of an incoming file request (They request a file).
* TODO: Implement.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is not implemented? Then why isn't this PR marked as WIP?

@gkfabs
Copy link
Author

gkfabs commented Nov 16, 2021

Thanks for running again the CI tools against my PR.

The 'TODO: Implement.' comments you spot in the code are wrong. The class are definitively implemented. I'll do the correction. I'll changes also to junit 5, the other comment readability problem and the logging.

If I do an extra library with this code, can I still use the same package names as yours ? ie org.jivesoftware.smackx ?

@Flowdalic
Copy link
Member

If I do an extra library with this code, can I still use the same package names as yours ? ie org.jivesoftware.smackx ?

I'd suggest that you substitute org.jivesoftware for a domain under your control (or, if you don't have one, something else). Then, if the code gets donated back, we switch the classes back into a package under org.jivesoftware, while keeping the trailing package names. This way, users can simply switch by performing a global search and replace in their codebase.

@Flowdalic
Copy link
Member

Closing, feel free to reopen a new PR once you want to donate code back for review.

@Flowdalic Flowdalic closed this Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants