Commit Graph

76 Commits

Author SHA1 Message Date
JC Brand
0564f0f592 Handle case were connection is not defined. 2016-04-13 10:09:47 +00:00
JC Brand
aee232421c Properly tear down when logging out or disconnecting.
Remove interval handler and the user activity handler.
Make sure the connection is reset when logging out.
Also removed the reconnectTimeout, instead debounce the reconnect method by 1 second.
2016-04-08 09:02:06 +00:00
JC Brand
94693f2d02 Some refactoring to fix issues with how/when chat rooms are shown
- Don't call show in a room's initialize method (instead let the code be more
  similar to normal chats, in that it should listen to the "show" trigger).
- Rename chatBoxShouldBeShown to chatBoxMayBeShown
- Implement auto_join for rooms only once boxes have been fetched already.
2016-04-05 11:23:16 +00:00
JC Brand
8e0f8f0a6d Add the ability to filter contacts by chat state.
The roster filter is now also remembered across page loads.
2016-04-02 11:30:54 +00:00
JC Brand
885c553e2e Bugfix. Login panel wasn't being rendered after logging out 2016-04-02 03:43:04 +00:00
JC Brand
a6c3b46237 Move the drag-resize code into a separate component. 2016-04-01 12:46:19 +00:00
JC Brand
1fbc7e0f3b Use attemptNonPreboundSession for reconnections.
Fixes reconnects for certain usecases not yet covered.
2016-03-31 13:11:31 +00:00
JC Brand
e0d1a32fdb Attempt to reconnect when authfail happens
and auto_login is true and credentials_url is set.

Trying to handle the case where tokens are used for credentials_url (and the
token is expired).

Not yet 100% happy with this implementation.
2016-03-31 12:32:11 +00:00
JC Brand
6b3fbc9998 Give feedback of error messages via Desktop notifications 2016-03-31 12:25:38 +00:00
JC Brand
2cbf20c6db Add the ability to fetch credentials for auto_login
via the new config option credentials_url
2016-03-31 08:38:43 +00:00
JC Brand
556d264747 Remove "optimization" code no longer used or relevant. 2016-03-29 11:50:50 +00:00
JC Brand
ed4b9a85cc Remove ChatBox views when they get closed.
Previously views were only hidden, but not removed. This was an unnecessary
"optimization" which introduced unnecessary complexity.

Problem solved was that closing minimized chats didn't dereference the model
for hidden "normal" chat views, causing an exception to be raised when trying
to log out.
2016-03-28 12:23:36 +00:00
JC Brand
f353fe8611 Bugfix for headline messages.
Couldn't handle messages with no "from" attribute.
Some refactoring to add code that checks if a messages is a headline to the
utils module.
Updated tests. Add sinon so that we can test returned value of spy.
2016-03-28 10:51:32 +00:00
JC Brand
b3e9a177e2 Merge pull request #617 from lixmal/master
Remove split of fullname. Fixes #609
2016-03-28 10:28:38 +02:00
JC Brand
3aefba3200 Change ping plugin to not have to use overrides.
Had to add a `reconnect` event to core.
2016-03-21 10:00:15 +00:00
JC Brand
82aa9fec2c Support for showing headline messages. 2016-03-21 10:00:10 +00:00
Viktor Liu
ad036ea75f Remove split of fullname. Fixes #609 2016-03-20 01:47:51 +01:00
JC Brand
9a449e3615 comment indentation 2016-03-18 08:49:32 +00:00
JC Brand
a2b8d04d84 Move config settings to the relevant plugins 2016-03-18 08:12:23 +00:00
JC Brand
36a875a402 Add stanza-specific event listener.
Therefore removing the `presence` event again.
2016-03-16 18:12:11 +00:00
JC Brand
1c961ab4d1 Emit an event presence when a presence stanza is received. 2016-03-16 15:59:07 +00:00
JC Brand
6506d4745a Call initialized event once everything in core has been set up 2016-03-16 13:50:35 +00:00
JC Brand
2173359718 Set dataType JSON of ajax request of prebind_url 2016-03-16 12:56:11 +00:00
JC Brand
e461b22ff9 disconnect and reset before attempting to reconnect. 2016-03-16 12:44:59 +00:00
JC Brand
08222182c5 Move VCard functionality into separate plugin 2016-03-16 11:21:27 +00:00
JC Brand
2fa39f2150 Move dependencies to the plugins that actually use them 2016-03-16 09:02:12 +00:00
JC Brand
3fd2225fae Don't try to restore if rid, jid and sid are passed in.
Fixes an issue whereby those tokens are passed in but not used and instead
converse attempts to restore the session (and then totally ignores the tokens
when it fails).

Makes sense to me that you'd want your passed in tokens to be used always, even
when there are restorable tokens.
2016-03-15 18:09:50 +00:00
JC Brand
80c26e708c Add new option strict_plugin_dependencies 2016-03-14 17:03:48 +00:00
JC Brand
9d9f64b2c3 declare namespace in relevant plugin 2016-03-14 16:46:04 +00:00
JC Brand
7039dbe01b Move chat minimization to a separate plugin 2016-03-14 16:38:43 +00:00
JC Brand
fc251db59e Let MUC plugin override the chatbox wrapper. 2016-03-14 16:02:43 +00:00
JC Brand
82107c0d96 Don't ever remove the _super obj 2016-03-14 15:59:33 +00:00
JC Brand
1676258c38 Move the MAM features to a separate plugin. 2016-03-14 14:04:36 +00:00
JC Brand
df3bcad0b3 Move roster view code into a separate plugin 2016-03-14 14:04:36 +00:00
JC Brand
fe47773c7f Move ChatView into separate plugin. 2016-03-14 14:04:36 +00:00
JC Brand
a1b31cd1ed Initial work on adding support for headline messages. 2016-03-14 14:04:31 +00:00
JC Brand
8b459c68b1 Call trimChats in the show method of the box view
Not in the onAdded handler.
2016-03-09 11:03:06 +00:00
JC Brand
d192b34919 onChatBoxFetched renamed to onChatBoxesFetched 2016-03-09 10:54:50 +00:00
JC Brand
6eb08bd42f Bugfix. show method must be debounced per instance
Otherwise it gets debounced for multiple instances and certain chat boxes will
then not get shown.
2016-03-09 10:53:39 +00:00
JC Brand
d893d9782a Improvement in when trimChats gets called
Don't call trimChats when the box is minimized or maximized, instead call it
only when the minimized chats toggle appears or disappears, since that's the
element that adds/removes space.

Also, a fix. 'onShow' has been renamed to 'onMaximized'
2016-03-09 10:26:14 +00:00
JC Brand
8b30c60592 Call minimize() not hide() when minimizing 2016-03-09 10:00:28 +00:00
JC Brand
ce9008a56a Rename onShow to onMaximized and add onMinimized 2016-03-09 09:59:25 +00:00
JC Brand
7b2f75ec72 Updated trimChats slightly. 2016-03-09 09:58:22 +00:00
JC Brand
2dbe2fc5a3 Bugfix. Need to set the context when calling a _super method 2016-03-09 08:39:04 +00:00
JC Brand
c793b846fb Only ask for permission once the user is already logged in
updates #443
2016-03-08 22:36:13 +00:00
JC Brand
550f7827bf Bugfix. Contact wasn't being sent. updates #443 2016-03-08 12:11:35 +00:00
JC Brand
0aa0c02124 Add tests for src/converse-notification.js. updates #443
In the process refactored the code being tested.

- Move notifications code in MUC to src/converse-notification.js
- Trigger the 'contactStatusChanged' event in RosterContact and not in
  ChatBoxView (which might not exist).
2016-03-08 10:44:27 +00:00
JC Brand
fd0c9cecb7 Log the err and call with null, then return. 2016-03-07 17:26:31 +00:00
JC Brand
efa4a9ff23 Fixes #577 Add a timeout config var for MAM 2016-03-07 17:16:57 +00:00
JC Brand
c2212833a1 Fixes #607, view.model is undefined. 2016-03-07 14:29:45 +00:00