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

Chat State Notifications (XEP-0085) #431

Merged
merged 7 commits into from
Jan 9, 2017
Merged

Chat State Notifications (XEP-0085) #431

merged 7 commits into from
Jan 9, 2017

Conversation

sualko
Copy link
Member

@sualko sualko commented Jan 5, 2017

Improve #424

@mmoqui Do you want to test this?

TODO

  • Add general option
  • Add user option

@sualko sualko added Testing and removed WIP labels Jan 5, 2017
@mmoqui
Copy link
Contributor

mmoqui commented Jan 5, 2017

Fine work. Much more better than my own work ;-)
Ok for testing it. Nevertheless you've forgotten to include the chatstate Stophe plugin.

@sualko
Copy link
Member Author

sualko commented Jan 5, 2017

Ok for testing it

Great. Can you report your results? Because if you find no issues, I will merge this.

you've forgotten to include the chatstate Stophe plugin

I don't think so, because it also revert the revert of your pr. On the command line I see your commit and there should be also the plugin entry. We will see how this will work 😉

@sualko
Copy link
Member Author

sualko commented Jan 5, 2017

We will see how this will work

It will not work 😆. I manually have to add your changes.

@sualko sualko modified the milestone: 3.1 Jan 5, 2017
if (usersComposing.length === 0) {
var duration = parseFloat(el.css('transition-duration'));

if (el.css('transition-duration').match(/s$/)) {
Copy link
Contributor

@mmoqui mmoqui Jan 5, 2017

Choose a reason for hiding this comment

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

el.css('transition-duration') returns sometimes undefined in the browser (both Chrome and Firefox) which throws an error when calling the match method on it. (This error then broke the composition notification.)
It is possible this error occurs when the .jsxc_composing div isn't more rendering (after a pausing and a timeout triggering the div removing)

Copy link
Contributor

@mmoqui mmoqui Jan 5, 2017

Choose a reason for hiding this comment

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

Just for information, I detected also a bug with the translations: the $t.() function doesn't take into account the variables and then we can see the name of the variable (_name_ for example) when a translated text is displayed (like in the desktop notifications)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will have a look into the duration issue. Could you open another issue for the translation problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

done. I just submitted an issue about the translation problem

@@ -26,7 +26,7 @@ module.exports = function(grunt) {
main: {
files: [{
expand: true,
src: ['lib/i18next/i18next.min.js', 'lib/jquery-i18next/jquery-i18next.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'],
src: ['lib/i18next/i18next.min.js', 'lib/jquery-i18next/jquery-i18next.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.chatstates/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi,
could you consider wrapping this over multiple lines? This would improve readability of the diff/patch in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I will try if this is possible with grunt-jsbeautifier.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

That looks already a lot better.

</div>
</div>
</fieldset>
</form>
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't yet seen, how this will look like, but the current (old) settings window is already taking the whole screen on a 1024x1024 browser window. Are jquery ui tabs an option here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We definitely have to improve the settings dialog, but I think this is worthy a second pr 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

Should I file an issue requesting that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

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

done: #434

@@ -130,9 +130,10 @@ jsxc.xmpp.chatState.onPaused = function(ev, jid) {
}

if (usersComposing.length === 0) {
var duration = parseFloat(el.css('transition-duration'));
var durationValue = el.css('transition-duration') || '0';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not || '0s'? I think that's the more or less offiecial default, according to https://developer.mozilla.org/en-US/docs/Web/CSS/transition-duration#Summary

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it doesn't matter. 0s would be maybe cleaner, but the result is the same 😄


if (el.css('transition-duration').match(/s$/)) {
if (durationValue.match(/s$/)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know, what values you expect anyway, but as I understand the above mentioned spec, there's also the option of "ms". So maybe: .match(/[^m]s$/)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch. Will fix it asap.

@sualko sualko merged commit 8fc5f04 into master Jan 9, 2017
@sualko sualko deleted the feature-chatstate branch January 9, 2017 09:11
@sualko
Copy link
Member Author

sualko commented Jan 9, 2017

Thanks to everyone you reviewed or contributed to this pr. It is really fun to work with you guys.

@ChristianTacke
Copy link
Contributor

Thanks! Yes it's cool to work with all of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants