Commit Graph

1048 Commits

Author SHA1 Message Date
JC Brand
06a6d6c4d0 Refactor out code for showing a new day in the chat box. 2015-07-19 12:22:10 +02:00
JC Brand
3ba12580c4 Store the isodate on chat messages in the DOM.
This will be useful later when we want to better place messages in the right
order.
2015-07-19 12:21:49 +02:00
JC Brand
6bd0037cbb Save the chat content area on the view.
To reduce $.find queries.
2015-07-19 12:08:43 +02:00
JC Brand
1a7a5e8054 Add a spinner when loading during infinite scrolling.
updates #306
2015-07-18 21:39:49 +02:00
JC Brand
ec02d34af9 Improvement. Don't lose your place with infinite upscroll.
updates #306
2015-07-18 09:20:13 +02:00
JC Brand
796582d96f Refactoring: got rid of the maybeFetchArchivedMessages method.
updates #306
2015-07-18 00:08:21 +02:00
JC Brand
3b2b4ed6c7 Some improvements to scrolling. 2015-07-17 23:46:02 +02:00
JC Brand
36306c7418 Improve support for infinite scrolling of arhived messages.
updates #306
2015-07-17 23:13:43 +02:00
JC Brand
99c7b9cb95 Add a new emitted event: serviceDiscovered.
Gets thrown every time converse learns of a supported server service.
Useful when 3rd party code wants to use API methods that depend on the service
being discovered first.
2015-07-17 20:34:48 +02:00
JC Brand
10e53468fb Initial work on adding infinite scrolling for archived messages.
updates #306
2015-07-17 20:11:13 +02:00
JC Brand
080d86e7fe Show most recent archived messages first.
- Also ensure that the archive.query API always return messages chronologically.
- Fix docs which wrongly state that null can be passed in.

updates #306
2015-07-17 17:56:47 +02:00
JC Brand
8625d1daba Add initial support for fetching and showing archived messages.
In the proces I added converse.chatboxes.getChatBox which allowed me to
remove the getWrappedChatBox method.
2015-07-17 16:49:58 +02:00
JC Brand
d992efc34b Optimization: only query for MAM prefs when necessary
updates #306
2015-07-17 16:43:20 +02:00
JC Brand
393dd6150d Use the Strophe.NS.XFORM constant 2015-07-17 16:42:00 +02:00
JC Brand
6cd9fb5500 Merge branch 'master' into mam 2015-07-14 10:43:35 +02:00
JC Brand
7fd475e2a3 Avoid adding a falsey value as resource. fixes #440 2015-07-14 10:27:40 +02:00
JC Brand
1a9771c717 Test code which receives archived messages and calls callback
updates #306
2015-07-12 23:58:07 +02:00
JC Brand
dca0472e80 For archive.query, call callback once after receiving all messages.
updates #306
2015-07-12 16:29:04 +02:00
JC Brand
9abbd1e8f0 Allow a Strophe.RSM object to be passed in to archive.query.
updates #306
2015-07-11 14:55:02 +02:00
JC Brand
ae58e3d1be Merge branch 'master' into mam 2015-07-11 13:53:28 +02:00
JC Brand
1766aa75f2 Bugfix: keepalive and autologin aren't mutually exclusive.
fixes #439
2015-07-11 13:51:44 +02:00
JC Brand
a0d344c7c4 Add better support for the results from a MAM query.
updates #306
2015-07-11 13:40:02 +02:00
JC Brand
7437cf2b42 Bugfix. Closured converse is not defined in utils. 2015-07-11 13:39:52 +02:00
JC Brand
1261a2525d Use Strophe.RSM for result set management. 2015-07-11 12:03:20 +02:00
JC Brand
b77d76b364 Started adding the API for querying archived messages. 2015-07-11 06:36:44 +02:00
JC Brand
eeeaddbe04 Add the ability to read and set MAM preferences. 2015-07-10 15:24:13 +02:00
JC Brand
2442eb74f4 Use Strophe.NS and only advertise enabled features. 2015-07-10 15:07:32 +02:00
JC Brand
5a5d3757ea Move the addEmoticons jQuery plugin to utils.js 2015-07-10 15:02:48 +02:00
JC Brand
3d7f5eda8e Some explanatory comments 2015-07-10 10:35:33 +02:00
JC Brand
eae706690f Renamed some methods and added docstrings, for clarity. 2015-07-04 10:24:00 +02:00
JC Brand
6736a5bce4 Test carbons of user's own sent messages.
Found and fixed a bug in the process.
2015-07-03 11:55:13 +02:00
JC Brand
0afa7ec188 Don't carbon copy OTR messages. 2015-07-03 11:41:14 +02:00
JC Brand
c2ccb2c693 New test and fixes to the message handler. updates #431 2015-07-02 11:23:52 +02:00
JC Brand
7703b9b33c Bugfix. Check if CSI is enabeld before sending. 2015-07-02 11:23:19 +02:00
JC Brand
b310d8a143 Add more logging to try and debug 431 2015-07-02 10:41:11 +02:00
JC Brand
722c172fbe Ensure that node and domain parts of the user's JID are lower case.
updates #234
updates #431
2015-07-01 19:44:14 +02:00
JC Brand
734d5b65ba Bugfix. Didn't add "bind". 2015-07-01 19:44:14 +02:00
JC Brand
d8c29c7e3f Make sure text is logged instead of XML.
Otherwise the log output is truncated when people copy paste from the console
(for bug reports).

updates #431
2015-06-29 11:57:37 +02:00
JC Brand
b47069b4f6 Add, test and document an API method for setting the user's status.
fixes #367
2015-06-27 21:21:27 +02:00
JC Brand
f73f61e622 Expose is_chatroom attribute on chat boxes returned by the API 2015-06-27 08:44:14 +02:00
JC Brand
0426f47941 Send out less active/inactive chat state messages.
Don't send out 'active' and 'inactive' chat state messages on blur and focus of chat box.
These events happen too often, causing lots of unnecessary messages.
2015-06-27 07:35:11 +02:00
JC Brand
14c868f134 With keepalive, don't send out a presence stanza on each page load. 2015-06-27 07:33:16 +02:00
JC Brand
9f7174dedc Replace $.proxy calls with bind (which is polyfilled in strophe.js) 2015-06-27 06:36:25 +02:00
JC Brand
c745e1ebff Cherry-pick only those languages from Moment which we support in converse.js 2015-06-22 22:20:02 +02:00
JC Brand
98f6ea8a3f Merge pull request #428 from thierrytiti/chat-with-pending
Enhancement #394 Option to allow chatting with pending contacts
2015-06-22 21:30:24 +02:00
JC Brand
0c67d2117b Bugfix. Just return locale string id. 2015-06-22 20:31:51 +02:00
JC Brand
e999f2c6df Merge branch 'i18n-momentjs' of https://github.com/thierrytiti/converse.js into thierrytiti-i18n-momentjs
Conflicts:
	converse.js

Also refactored the code to adhere to the style guide.
2015-06-22 19:54:51 +02:00
JC Brand
56cd540f5d Update changelog after merge. 2015-06-22 18:55:02 +02:00
JC Brand
ed3be3730c Merge branch 'master' of github.com:emmanuel-florent/converse.js into emmflorent 2015-06-22 18:51:12 +02:00
JC Brand
21a3b44050 Don't send CSI or auto_away/xa stanzas when not auth'd
This is to deal with reconnects. Originally @thierrytiti checked for
`connection.connected` but I think that might still pose a problem when
reconnecting is in process and the user is not yet authenticated again.

This makes pull request #426 unnecessary.
2015-06-22 18:39:12 +02:00
JC Brand
868435173f Decouple automatic away and XEP-0352 support.
- Add new config option csi_waiting_time for CSI support.
- The auto_away and auto_xa options won't send out CSI stanzas if csi_waiting_time is 0
- Update docs and add tests for both features.
2015-06-22 00:01:31 +02:00
JC Brand
7551c629bd Rely on Strophe's keepalive function instead of our own.
I recently added keepalive functionality to Strophe, similar to what was
already in converse.js. It's stable enough now that we can rely on it
instead.
2015-06-19 18:01:42 +02:00
JC Brand
66386d5b25 Rely on "pagehide" first if it's available.
This is because "pagehide" is fired in more situations and because unload
is not supported on mobile Safari.
2015-06-19 18:00:22 +02:00
JC Brand
c47c8bd7eb Use "strict" mode again and fix styling.
We "use strict" outside of the function that gives issues on Safari.
2015-06-19 17:58:28 +02:00
thierrytiti
479bab2ce4 Enhancement #394 Option to allow chatting with pending contacts 2015-06-18 16:31:30 +02:00
eflorent
fdfd98ac82 Fix simple type on variable name closes #427
At some point an improbable condition reached a typographic error.
2015-06-16 21:03:57 +00:00
JC Brand
9a2ed106c7 Bugfix. Don't reconnect when disconnect was due to auth err. 2015-06-07 18:29:36 +02:00
JC Brand
94514dfe1e Attempt to reconnect only after 5 seconds. 2015-06-07 18:26:32 +02:00
JC Brand
d6bb3f8502 Small changes to connection status handler.
* Rename onConnStatusChanged to onConnectStatusChanged
* Provide human readable debug feedback on onConnectStatusChanged
2015-06-07 18:23:29 +02:00
JC Brand
f86ef934e8 Refactor the session resumption code and fix a bug after recent merge.
Split the code into two new methods for the prebind and non-prebind
usecase.
2015-06-05 14:48:16 +02:00
JC Brand
085d91b546 Provide support for browsers which don't have beforeunload event. 2015-06-05 14:48:16 +02:00
JC Brand
334f095774 Merge branch 'master' into plugins-refactor 2015-06-04 12:11:56 +02:00
JC Brand
a77744d867 Two trimChats bugfixes. See below.
- TrimChats was called before a newly maximized chat had its final width which
  prevented it from working as intended.
- We cannot check for available space by using the width of the #conversejs
  element anymore, since it now has variable (auto) width. So we check against
  the body width instead.
2015-05-31 14:50:41 +02:00
JC Brand
f4edf75c72 Bugfix. Fetched chat boxes weren't being shown automatically. 2015-05-31 14:46:12 +02:00
JC Brand
bf61122805 Avoid trying to retrieve non-existing models. fixes #415 2015-05-31 14:39:28 +02:00
JC Brand
a412bd92c4 Merge branch 'MUC-toggle-Call' of https://github.com/thierrytiti/converse.js into thierrytiti-MUC-toggle-Call 2015-05-29 10:12:40 +02:00
JC Brand
66420962f7 Make sure the pong handler is always registered.
47e00ae005
2015-05-28 10:59:10 +02:00
thierrytiti
0745cdeaca toggleCall already inherits from ChatBoxView 2015-05-28 10:31:04 +02:00
JC Brand
47e00ae005 Various bugfixes.
- HAS_CSI might be called before features have been received. Instead, set a
  flag whenever a feature is received and check for that flag.
- Converse.ping was sending stanzas to the bare jid instead of to the domain.
- The handler that updates the date the last stanza was received must return
  true so that it gets called again.
- Only register the Pong handler if Ping is enabled.
- Rename lastMessage to lastStanzaDate to make it more clear.
2015-05-27 21:53:15 +02:00
JC Brand
e0a58efcfa Linting and code formatting.
Also use and add a Strophe namespace for CSI.
2015-05-27 21:49:12 +02:00
JC Brand
8e5d481e1c Merge branch 'auto-away' of https://github.com/thierrytiti/converse.js into thierrytiti-auto-away
Conflicts:
	converse.js
2015-05-27 20:01:22 +02:00
thierrytiti
fb589398ad XEP-0199: XMPP Ping
Use modified StropheJS ping plugin (AMD support)
Add Ping functionality
Add Pong handler

Fix to issue #144:
2015-05-27 18:14:58 +02:00
thierrytiti
f75b3a075a I18N: detect language for MomentJS
user language detection in order to format date and time in correct
locale
2015-05-27 14:29:22 +02:00
thierrytiti
24b204e8a4 Offline Pretty Status
add offline as possible case to enable translation
2015-05-26 18:36:17 +02:00
thierrytiti
7366bb709d MUC: missing toggle Call handler and function
the Call button is visible but no action is done
2015-05-26 16:39:06 +02:00
JC Brand
fc1768d12d Fixes #406.
Call to registerRosterXHandler and registerPresenceHandler on onReconnected give exception.
2015-05-21 17:04:56 +02:00
JC Brand
6afcc0fbe1 Bring lang detect code in line with coding style.
Change html files so that we auto-detect the lang now.
2015-05-20 19:31:59 +02:00
JC Brand
1d0ffe34ab Merge branch 'detect_lang' of https://github.com/thierrytiti/converse.js into thierrytiti-detect_lang 2015-05-20 19:20:17 +02:00
thierrytiti
a660f853c1 XEP-0352: Client State Indication
XEP-0352 support added to Auto Away Mode
2015-05-20 12:12:08 +02:00
JC Brand
6dcda4ad42 Ensure that roster contact's jids are bare 2015-05-18 11:42:29 +02:00
JC Brand
9db289df86 Bugfix. Automatic anonymous login didn't work if keepalive=false. 2015-05-16 16:28:23 +02:00
JC Brand
6260ba2864 Bugfix. Don't overwrite _super every time an override is made. 2015-05-16 16:27:51 +02:00
JC Brand
ea687d67f9 Merge branch 'master' into plugins-refactor 2015-05-15 14:48:12 +02:00
JC Brand
68bcc9d0eb Merge pull request #399 from thierrytiti/bugfixes
Bugfix. fullname is null
2015-05-15 14:41:18 +02:00
JC Brand
96df8dea97 Merge branch 'Placeholder-for-translation' of https://github.com/thierrytiti/converse.js into thierrytiti-Placeholder-for-translation
Conflicts:
	src/templates/toolbar.html
2015-05-15 14:39:02 +02:00
thierrytiti
7a359562ad Add placeholder for 'Insert a smiley' 2015-05-15 12:01:29 +02:00
JC Brand
3ea3ac52a3 Merge branch 'master' into plugins-refactor 2015-05-15 11:32:33 +02:00
thierrytiti
e64c19fc18 Bugfix. fullname is null
wrong callback argument mapping in XmppStatus initialize: fullname is
null
2015-05-15 11:05:26 +02:00
JC Brand
cd759a7174 Fixes around using bare jid for roster and chats.
- Make sure the bare jid is used as roster contact id.
- Save the resource when creating a new roster contact
- In getWrappedChatBox, get roster item by bare jid
- In getWrappedChatBox, make sure the chat box is created from bare jid
2015-05-15 00:33:23 +02:00
JC Brand
3fc0ef1e70 Remove snippet of code that's not being used. 2015-05-15 00:33:23 +02:00
thierrytiti
e35c5a4fa3 Indentation 2015-05-14 13:55:39 +02:00
thierrytiti
be102de031 Bugfix if auto_away=0 and auto_xa>0
In this case, it will force changing presence even if the user
specificly set another status.
2015-05-13 16:25:26 +02:00
thierrytiti
6034932523 Update converse.js 2015-05-13 13:57:22 +02:00
thierrytiti
d631af58a9 Automatic Away Mode
Add functions for changing user presence to ``away`` or ``xa``
2015-05-13 13:51:24 +02:00
thierrytiti
f521532f2f Language Detection
Replace default en language to autodetection if no i18n setting is set.
2015-05-11 17:36:12 +02:00
JC Brand
42437ffa91 Bind overridden methods to the plugin context 2015-05-10 17:15:15 +02:00
JC Brand
91638cabe1 Add support for "overrides" namespace convention in plugins. 2015-05-10 00:51:36 +02:00
Guillermo Bonvehí
70191eac00 Added login-panel placeholder and roster-item Name translations
This will allow to translate 'user@server' and 'password' in the login
screen and also in the roster-item tooltip, there's 'Name:' which can
now be translated
2015-05-08 14:08:09 -03:00
Guillermo Bonvehí
71ea60e44a Fixed an error that appears when unload event is triggered
This happens when you load a page with converse and do not login to
the chat. It can be tested in converse.org preserving logs while
navigating to another page.
Inside clearSession there's a call to roster which is not initalized
and also another one to controlbox.save which is not set so it fails
with an url error during sync.
2015-05-07 12:47:32 -03:00
JC Brand
c0bec459a0 Bugfix. See below.
Manual login doesn't work when websocket_url is set and not bosh_service_url

It's already a while since we don't include an input for the bosh_service_url in the login panel.
2015-05-06 16:46:37 +02:00
JC Brand
9f5f5da7ed Created method insertIntoPage
Put the code that inserts a chat box into the page in it's own method,
so that it can be overridden from a plugin.
2015-05-03 17:43:22 +02:00
JC Brand
d6a1dee2d2 Rename the placeholder for contact adding
to make it clearer what a JID should look like.
2015-05-02 00:21:11 +02:00
JC Brand
aa3de742c0 Merge branch 'master' into roster_refactor 2015-04-25 23:06:59 +02:00
JC Brand
d6038c7c7b Allow the URL to the sounds to be configurable.
Made some modifications to the code contributed by @thierrytiti and documented
the change.

Fixes #344
2015-04-25 22:41:29 +02:00
thierrytiti
310d2b77f3 typo 2015-04-25 22:26:10 +02:00
thierrytiti
7ec44d56d5 add sounds path 2015-04-25 22:25:59 +02:00
thierrytiti
addd2c2ac3 Bug in parsing search result 2015-04-25 22:20:15 +02:00
JC Brand
96e8a285b7 Merge branch 'master' into roster_refactor 2015-04-21 17:36:13 +02:00
JC Brand
6dc355a02a Show the domain when rendering a legacy registration form.
Also updated the changelog with #377
2015-04-21 17:21:26 +02:00
JC Brand
848c13eb62 Merge branch 'master' into roster_refactor
Conflicts:
	dev.html
2015-04-21 16:51:15 +02:00
Guillermo Bonvehí
8934043d79 Submit registration form as xform or legacy
Support to send the registration form as legacy or xform, we
use the same variable form_type that was already being used when
calling render
Added submission tests
2015-04-21 11:05:03 -03:00
Florian Cargoët
8b695be4d7 Fix group visibility on page load.
Close #374
2015-04-17 17:06:16 +02:00
Florian Cargoët
63e3794ba7 Fixes #372 2015-04-17 16:24:02 +02:00
JC Brand
292d4a1bc9 Ignore messages sent to a different resource 2015-04-16 09:37:46 +02:00
JC Brand
f7a077a911 Merge branch 'master' into roster_refactor
Conflicts:
	converse.js
2015-04-15 22:08:19 +02:00
JC Brand
36d9dbdea5 Use Strophe for managing namespaces. 2015-04-15 22:06:23 +02:00
JC Brand
34e2cfc191 Merge branch 'master' into roster_refactor 2015-04-15 21:52:14 +02:00
JC Brand
1b6e67ae73 Don't call updateVCard if use_vcards is false. 2015-04-15 21:20:19 +02:00
JC Brand
3451fcf01e Only set contact status offline if there aren't any other resources available. 2015-04-13 17:02:14 +02:00
JC Brand
f399c5f681 Add more protocol tests.
* Unsubscribing
* Incoming subscription requests.

Noticed that it's not necessary to call "unauthorize" when setting
subscription="remove".
2015-04-10 16:30:04 +02:00
JC Brand
e6f5b95da7 Fix tests by allowing removeFromRoster to be spyable. 2015-04-10 13:04:00 +02:00
JC Brand
1ce328783c Also add tests for case where contact declines request.
Did a bit of renaming and fixed a bug in updateContact where a user wasn't
created when it should have been.
2015-04-10 13:01:31 +02:00
JC Brand
838ad13605 Merge branch 'master' into roster_refactor
Conflicts:
	converse.js
2015-04-10 01:30:02 +02:00
JC Brand
6ef2e50387 Merge branch 'anon_login' 2015-04-09 14:09:26 +02:00
JC Brand
2e11f99d82 Bugfix. Also make sure to remove previous from/to class 2015-04-09 10:35:12 +02:00
JC Brand
c05d17ca25 Expand the protocol tests.
* Fixed a bug in the process which prevented "to" contacts from being shown as
existing.
* Add "to" or "both" as classes on the contacts to indicate their
subscription status.
* Delete roster handlers in tearDown method to avoid them being registered
multiple times.
2015-04-08 19:51:33 +02:00
JC Brand
eb00dcd44a Bugfix. Paths to sound files should be absolute. 2015-04-08 17:22:49 +02:00
JC Brand
995c5fdb44 Make release 0.9.2 2015-04-08 13:41:31 +02:00
JC Brand
b177a6a7a0 Bugfix for incorrect roster height when allow_contact_requests=false.
Also update changelog and fix some linting errors.

Fixes #360
2015-04-08 13:12:29 +02:00
JC Brand
c7bf1713d8 Add new spec protocol for testing the XMPP protocol.
Already testing the first 3 sections of RFC-3921 section 8.2 "User subscribes to contact".
2015-04-08 10:35:14 +02:00
JC Brand
ef7605d363 More fixes after live testing of roster subscriptions.
Also, added code to acknowledge a subscription being accepted.
See https://xmpp.org/rfcs/rfc3921.html#substates-ack
2015-04-07 20:04:27 +02:00
JC Brand
96396fdc6e A few fixes after some "real world" tests. 2015-04-07 18:23:45 +02:00
JC Brand
330b1434bd Completely remove strophe.roster as a dependency. 2015-04-06 20:55:38 +02:00
JC Brand
a4475a5459 Stop using strophe.roster in unsubscribe method. 2015-04-06 13:52:58 +02:00
JC Brand
7f8da77133 See below.
Refactor out the code for sending an IQ to add a roster contact.
And then call that from acceptRequest.
2015-04-06 13:43:27 +02:00
JC Brand
5b0a88ccdb Some more refactoring so that we can remove strophe.roster.
Some changes to presenceHandler and handleIncomingSubscriptions to avoid using
strophe.roster as well as to remove duplicate code.
2015-04-06 13:41:48 +02:00
JC Brand
1ea770c79a Add the ability to reject presence subscriptions.
Still part of the refactoring of strophe.roster.
2015-04-06 12:26:08 +02:00
JC Brand
f380e11851 Initial refactoring of roster and presence subscriptions.
The goal being to be able to remove strophe.roster completely.
2015-04-06 11:10:05 +02:00
JC Brand
18fd854dc4 Remove unnecessary return statement and expression. 2015-04-05 17:09:14 +02:00
pzia
4df2058cd1 Adding 'rooms' API (see jcbrand/converse.js#355 ) 2015-04-05 08:22:10 +02:00
JC Brand
df0c55ed4d Merge branch 'master' into anon_login 2015-04-04 11:32:22 +02:00
Florian Cargoët
a9a4935ed9 Fix a timeout bug in chat state notifications 2015-04-03 09:47:31 +02:00
JC Brand
a2be2567d2 Allow auto_login also with a provided jid and password.
* Update the docs to mention the new ``authentication`` option.
* Update failing tests due to ``prebind`` being replaced with ``authentication``.
* Rename 'manual' value for authentication to 'login' since it's used in both manual and auto cases.
2015-04-02 13:07:59 +02:00
JC Brand
a2d27ee971 Merge branch 'master' into anon_login
Conflicts:
	converse.js
2015-04-02 12:23:13 +02:00
JC Brand
5ec7c67b50 Don't automatically show a chat box when creating it. updates #357
This caused a bug whereby a chat box would open only on chat state
notifications.

Also refactored the chats.open and chats.get methods so that they now reuse the
same map function and so that chats.get can now return any chat box and not
just already open ones.

Updated the tests to properly test this and updated the docs.
2015-04-02 02:01:53 +02:00
JC Brand
a902ba2d8a Merge pull request #357 from floriancargoet/fix/state-notifications-reopen-box
Fix the known bug where a state notification reopens a chat box
2015-04-02 01:46:26 +02:00
JC Brand
a68e3bdeea Merge pull request #358 from floriancargoet/fix/shared-occupants-list
Fix the ChatRoomOccupants storage id
2015-04-01 23:22:52 +02:00
Florian Cargoët
400cfa38a7 Fix the ChatRoomOccupants storage id 2015-04-01 15:20:46 +02:00
Florian Cargoët
b1272a697b Fix the known bug where a state notification reopens a chat box 2015-04-01 15:11:24 +02:00
Florian Cargoët
06c3304d0d Fix the plugin extend function 2015-04-01 14:59:13 +02:00