Commit Graph

119 Commits

Author SHA1 Message Date
JC Brand
aa52ba5b94 Add method trimOpenChats. Updates #61 2014-04-26 06:55:52 +02:00
JC Brand
b307d5170b Date handling is now done with moment.js 2014-04-25 23:44:10 +02:00
JC Brand
dec674fae2 Bugfix. Opened chatboxes weren't focused...
...when clicking on a contact in the roster
2014-04-24 20:55:07 +02:00
JC Brand
4937fafea4 Add tests for new "clear" button. 2014-04-24 19:21:38 +02:00
JC Brand
14d90bc99c Upgrade dependencies to their latest versions 2014-04-19 05:12:24 +02:00
JC Brand
bf6474ff6d Upgrade jquery to 1.11.0 and add jquery.browser 2014-04-19 01:52:44 +02:00
JC Brand
7d472eb26d Add new dependency moment.js
Use it to better compare dates when trying to determine whether a message falls
on a different day.

Also upgraded some dependencies' versions.
2014-04-19 01:30:48 +02:00
JC Brand
b88113c246 Fixed some failing tests.
Some of the tests were failing because they didn't expect the controlbox to be
returned from localStorage.
It's too long ago that I've looked at this branch for me to say whether this is
a legitimate bug or not.
Will have to investigate further.
2014-04-18 17:42:35 +02:00
JC Brand
3cfcb2ae34 2 controlbox bugfixes and spec typo.
* Save controlbox to containing collection
* Call refreshWebkit after closing controlbox
2014-03-15 05:52:00 +02:00
JC Brand
6290f954a7 Add toggle test for chatrooms 2014-03-14 21:35:43 +02:00
JC Brand
bb0f49cf4d Add a counter to show unread msgs when chat is minimized 2014-03-09 13:31:01 +02:00
JC Brand
9849daacf9 Merge branch 'master' into 0.8
Conflicts:
	bower.json
	converse.js
	docs/CHANGES.rst
	spec/chatbox.js
	tests/utils.js
	tests_main.js
2014-03-09 08:18:00 +02:00
JC Brand
8001444a1c Add another URL test with double quotes. 2014-03-09 05:51:21 +02:00
JC Brand
74779afd66 Ensure that URLs in messages are properly escaped 2014-03-05 08:03:52 +02:00
JC Brand
34fa05888d Add (currently still disabled) test for...
message counter for minimized chats
2014-03-05 02:10:29 +02:00
JC Brand
25cc229019 Refactor message handling
- use the same method for both normal and OTR messages
- fix /me actions for OTR messages
- rename messaging methods to minimize ambiguity

Conflicts:
	converse.js
	tests/utils.js
2014-03-05 01:46:19 +02:00
JC Brand
317ab95cd8 Refactor message handling
- use the same method for both normal and OTR messages
- fix /me actions for OTR messages
- rename messaging methods to minimize ambiguity
2014-03-05 01:23:45 +02:00
JC Brand
c2b7caaedf Add a test for chatbox toggling. 2014-03-04 20:16:39 +02:00
JC Brand
b14538b441 Rename ChatBoxesView to ChatBoxViews 2014-03-04 15:54:36 +02:00
JC Brand
1567b212c3 Add closure get/set methods for rosteritem views 2014-03-04 15:49:02 +02:00
JC Brand
d20ca10638 Add closured get/set methods for views from chatboxesview 2014-03-04 15:09:16 +02:00
JC Brand
ac0042fdf9 Extend the "close chat" test with a normal chatbox usecase 2014-03-04 13:22:49 +02:00
JC Brand
11b59b31d3 Fix tests after all the refactoring... 2014-03-01 01:57:20 +02:00
JC Brand
1ce7620b88 Merge remote-tracking branch 'origin' into 0.8
Conflicts:
	converse.js
	docs/CHANGES.rst
	index.html
2014-02-23 02:54:35 +02:00
JC Brand
18d6a91881 Add API method to retrieve the SID. Fixes #93 2014-02-12 12:37:39 +02:00
JC Brand
30f3114c7c Add method to get the latest RID. Updates #93 2014-02-12 12:19:12 +02:00
JC Brand
62d59ff3e4 Refactor some OTR code into a Backbone model and adapt tests. 2014-02-12 07:12:00 +02:00
JC Brand
398142c7de Add a test for the passphrase storage. Updates #111 2014-02-12 02:02:45 +02:00
JC Brand
e3b8a8f9dd Move event emitter tests out into their own spec 2014-02-12 02:02:25 +02:00
JC Brand
18cacdc94b More templates refactored into separate files. 2014-01-19 11:22:56 +02:00
JC Brand
4e9dc08b0b Clean up after running tests, by closing chatboxes. 2014-01-19 07:02:18 +02:00
Pete Nicholls
6002e0fdf9 Use converse.emit to dispatch call button event 2013-12-19 12:26:11 +13:00
Pete Nicholls
db60894834 Add optional call button to chat box toolbar 2013-12-19 12:26:07 +13:00
JC Brand
4186bf3ca3 Throw event onRosterViewUpdated whenever the roster HTML changes. Fixes #101 2013-12-18 16:30:19 +02:00
JC Brand
8633d23738 Sanitize text messages to disable Javascript injection attacks.
Thanks to hejsan.
2013-12-18 13:51:59 +02:00
JC Brand
c8bf0491c8 Add new spec to test converse.js's API. Fixes #48 2013-12-16 20:00:21 +02:00
JC Brand
326e5a188b Rename the spec files 2013-12-16 20:00:15 +02:00
JC Brand
d1bf5b8466 Add event emitter tests for chatrooms. Updates #48 2013-12-16 19:19:25 +02:00
JC Brand
cdc350f592 Add more tests for events emitting. Updates #48 2013-12-16 15:27:07 +02:00
JC Brand
1939ddac23 Test events emitted when own status or status message is changed. Updates #48 2013-12-15 18:13:39 +02:00
JC Brand
7a5bc7fe65 'ask' attribute of 'subscribe' is only for 'pending out' requests.
Did more investigation with regards to subscription requests.

As far as I can tell, roster updates will only show ask='request' for 'pending
out' requests.

For 'pending in' requests (what converse.js calls requesting contacts), roster
updates are not used and instead a presence stanza with type 'subscribe' is
used.

This makes sense. When sending a presence with type 'subscribe', we need a way
to keep track of our outgoing subscriptions. The XMPP server helps us do this by
adding a user to our roster with ask='request' and subscription='none'.

When our contact receives our presence with type 'subscribe', they have the
information they need. If they go offline and online again, the XMPP server
will resend the presence with type 'subscribe'. So a roster item is not needed.

In convere.js's internal representation of the roster (via the RosterItems backbone
object) we need to add roster items for 'pending in' contacts so that we can
render them and we need to know whether they are 'pending in' or 'pending out'.

We already know they're 'pending out' when ask='subscribe' and
subscription='none'. For 'pending in', since these roster items are only stored
locally and not on the XMPP server (because 'pending in' requests are handled
via <presence> stanzas and not the roster) we add a special attribute
'requesting'.
2013-11-06 09:54:58 +02:00
JC Brand
fb8e2cde72 Roster item 'ask' property is always 'subscribe' for subscription requests
* 'pending' state is denoted by subscription='none', ask='subscribe'
* 'requesting' state is denoted by subscription='from', ask='subscribe'

Reference: http://xmpp.org/rfcs/rfc3921.html#int

I'm not yet 100% sure with regards to the 'requesting' state, I can't find
anything about it in the above mentioned reference, but apparantly that's what
prosody's roster response looks like (e.g. <item jid='XYZ' ask='subscribe'
subscription='from'/> ).

With ejabberd I haven't yet received such a roster response and contact
requests are always handled via presence stanzas.

updates #81
2013-11-06 09:04:44 +02:00
JC Brand
fc3a08400e Add tests for the chat toolbar.
Including the emoticon menu and the OTR menu.
More tests needed for OTR in particular.
2013-11-03 22:28:44 +02:00
JC Brand
00e0782576 Add a test that checks for delayed messages. Fixes #76
Messages older than one day do indicate it.
2013-11-03 13:24:18 +02:00
JC Brand
d7d8948eba Refactor ChatRoom tests (move code to utils.js) 2013-11-03 12:02:25 +02:00
JC Brand
13babe4fae Refactored chatbox tests to be run independently 2013-11-03 11:38:48 +02:00
JC Brand
44fe406a34 Refactored tests.
Split MainSpec out into ChatBoxSpec and ControlBoxSpec.

Part of trying to have looser coupling between tests so that they can be run
independently.
2013-11-02 13:37:38 +02:00
JC Brand
b0f12d0f79 $.proxy can be used to pass in extra args, no need for fn.bind 2013-11-02 12:03:57 +02:00
JC Brand
ff345dcf51 Move mock.js to tests dir. Add utils.js
Both changes from tests-refactor branch
2013-11-02 11:32:52 +02:00
JC Brand
38c26013d0 Simplify the boilerplate HTML require even more.
Use id 'conversejs' instead of 'chatpanel'.

The controlbox toggle is now generated via a backbone view, you don't need to
manually include it in your markup.
2013-10-20 22:42:34 +02:00