Commit Graph

505 Commits

Author SHA1 Message Date
JC Brand
fdb0425722 Make sure to scroll down after revealing the chat room messages. 2016-08-18 09:08:12 +00:00
JC Brand
6ac4f2601d Fixes #677 Chatbox does not open after close
Problem was a race condition between hide and show methods.
Solution was to not hide the chat box during the initialize method.
2016-08-12 20:38:39 +00:00
JC Brand
4402798dcd Don't add resources from message stanzas. Fixes #632
For each user we keep a list of currently online resources. These resources
were taken from both presence and message stanzas.

Receiving a message doesn't however indicate that the user is online,
especially in the case of archived messages.

This also abused the semantics of messages, which are meant to indicate
user presence.
2016-08-12 19:45:47 +00:00
JC Brand
1f805fa1e2 Fixes surrounding chat state notifications in MUC.
- Send chat state notifications with type groupchat for MUC.
- Don't show own chat state notifications if received from the server.
2016-08-12 17:00:15 +02:00
JC Brand
fe46f2ee77 Chat state notifications are now also sent out from chat rooms. 2016-08-12 12:52:33 +00:00
JC Brand
9d28145724 Bugfix. For reserved rooms, only render config form when they're new. 2016-08-12 10:39:57 +00:00
JC Brand
66d80cc4db New configuration setting muc_instant_rooms.
This option is by default set to `true` which entails no changes in behavior
compared to previous versions of converse.js.

If set to `false`, then rooms first need to be configured before they can be
joined by other users (so-called "reserved" rooms).

More info on "instant" and "reserved" rooms here:
http://xmpp.org/extensions/xep-0045.html#createroom
2016-08-11 16:05:07 +00:00
JC Brand
cd46e96783 Converse.js's plugin architecture has been moved to a separate repo
See https://github.com/jcbrand/pluggable.js
2016-08-11 14:05:25 +00:00
JC Brand
34eb8cdfc4 Add getDefaultNickname method
so that plugins can have a different mechanism for determining the default
nick.
2016-08-11 12:19:43 +00:00
JC Brand
462a43b891 Add new config option muc_nickname_from_jid
which if set to `true` will let converse.js automatically take the node part of
a user's JID as their nickname when entering a room.

If there is a nickname clash, then the nickname will be disambiguated by adding
integers to it.

For example, john will become john-1, then john-2 and so forth.
2016-08-11 12:02:35 +00:00
JC Brand
561c138edd Bugfix. Allow multiple MAM queries to be made simultaneously. 2016-07-28 18:01:37 +02:00
JC Brand
e28aba5a59 Fixes #645. When accepting a contact request...
the contact didn't appear under the pending contacts list.
2016-07-28 10:35:43 +00:00
JC Brand
a1e24c95c9 Add nickname to chat message when clicking on room occupant.
Allows you to easily mention someone in your message.
2016-07-26 09:31:23 +00:00
JC Brand
0f3526c570 Bugfix. Still render server input field, just make it hidden. 2016-07-26 08:30:26 +00:00
JC Brand
e109c54cf4 Avoid having a separate configuration in demo folder 2016-07-26 08:22:31 +00:00
JC Brand
8a42e241b7 We no longer need to force the user to provide a JID
when calling `converse.rooms.open`.
2016-07-26 07:27:28 +00:00
JC Brand
172ce7e0ce Remove the members-list work and keep the nickname form stuff
It's not stable yet and XMPP server support is very patchy.
However, the nickname form work can be merged into master.
2016-07-26 07:14:22 +00:00
JC Brand
0d105b8a6e make sure room nick is remembered across page loads. 2016-07-26 07:12:56 +00:00
JC Brand
be47ceaab5 In case of a nickname conflict, enable the user to choose a new one 2016-07-26 07:12:56 +00:00
JC Brand
f56b85cff7 Check whether the user has a reserved nickname
when they enter a chat room. If they have, we'll use that, otherwise we render
a form where they can specify their nick.

Some chat room tests now fail and still need to be fixed.
2016-07-26 07:12:56 +00:00
JC Brand
cd75b2efab Let the user choose their nick after opening a chat room
This change is with an eye on supporting reserved nicknames, in which case the
user who has a reserved nickname won't have to choose a nick upon joining a
room.
2016-07-26 07:12:56 +00:00
JC Brand
5ffebda8c2 Fix failing tests 2016-07-26 07:12:56 +00:00
JC Brand
c1be16aaab Bugfix. Store and find occupant views by id, not jid
because we don't always have a jid...
2016-07-26 07:12:56 +00:00
JC Brand
93a8dfc024 Indicate whether a room occupant is online or not. 2016-07-26 07:12:56 +00:00
JC Brand
09802cfbde Add invitees to the member-list of the room. 2016-07-26 07:12:56 +00:00
JC Brand
60f433d12e Initial work on managing a room's member's list. 2016-07-26 07:12:56 +00:00
JC Brand
88d2142501 Minor improvements around anonymous login.
You can now provide the JID of the server either via `converse.initialize` or
via `converse.user.login`.
2016-07-24 10:54:57 +02:00
JC Brand
0c393cf286 Move some utility methods to utils.js 2016-07-18 11:41:31 +00:00
JC Brand
01e10a9b24 Bugfix. Don't call Jed's translate method
before converse.initialize has been called. Otherwise we won't get
translations.

Updates #669
2016-07-18 11:34:31 +00:00
JC Brand
71381e2f22 Show requesting contacts when filtering by chat state.
Also add an initial test case for filtering by chat state.
2016-07-18 08:42:07 +00:00
JC Brand
7de76924b4 Create the minimized_chats obj during _initialization
and don't remove during `_tearDown`.

Fixes bug in `trimChats` when logging in again and `converse.minimized_chats`
is undefined.
2016-07-05 06:21:25 +00:00
JC Brand
5ed8dfbe0a Get chat box views by id
Fixes bug when fetching controlbox, which doesn't have a jid
2016-07-05 07:43:34 +02:00
JC Brand
95d7c306d4 Add more logo sizes, resize and pad.
Use the 128x128 icon for Desktop notifications
2016-07-02 13:40:51 +02:00
JC Brand
d6ef4fc5ca Add method hook for adding more attrs to send to the message template 2016-07-01 14:27:26 +02:00
JC Brand
1666a45c6b Handle case where this of overridden method is not the pluggable
due for example to it being called by an event handler.
2016-06-30 14:15:05 +02:00
JC Brand
01f576e505 Return all rooms or private chat when caling get without arguments 2016-06-24 10:54:39 +02:00
JC Brand
be122af3ed Add tests for rendering of error messages. 2016-06-23 08:56:15 +02:00
JC Brand
e06a34a905 Some initial work on show messages with type "error" 2016-06-22 18:47:07 +02:00
JC Brand
9e8674ef55 Rename ChatBoxView.insertIntoPage to ChatBoxView.insertIntoDOM
to ensure naming consistency, we have the same method on `ChatRoomView`.
2016-06-22 15:54:22 +02:00
JC Brand
081d377881 Move code from plugins to core.
Move init of RosterGroups collection and presenceHandler registration out of
the controlbox and rosterview plugins and into core, since this code is
generally useful (indeed necessary) even without those plugins.
2016-06-22 10:25:01 +00:00
JC Brand
9cfec0ba8c Show requesting contacts at the top of the roster view. 2016-06-21 17:48:18 +00:00
JC Brand
7f753040de Move roster-related models/collections to core 2016-06-21 17:36:40 +00:00
JC Brand
b90ad3aa6e Don't check visibility before hiding.
In some cases the element is not visible,but we want to set 'display: None'
regardless, for example in cases where you only want one single chat of
multiple to be visible at any one time, while hiding it behind a sidebar.
2016-06-17 17:43:09 +02:00
JC Brand
d2933b896e Ignore messages without a body 2016-06-17 09:33:09 +00:00
JC Brand
705c043852 Fixes concerning tab visibility 2016-06-17 09:30:47 +00:00
JC Brand
10ca2900d4 Add a "create" parameter to rooms.get
to indicate whether the room should be created if not found.
2016-06-17 09:30:31 +00:00
JC Brand
95c5f9d420 Better support for checking whether the page is visible or not. 2016-06-16 16:14:22 +00:00
JC Brand
ee6d7ebd7a Bugfix. Need to strip the resource to get the room jid 2016-06-16 17:24:58 +02:00
JC Brand
e12c165454 Add new event pluginsInitialized and use it in converse-notifications
By listening for this event before registering event handlers, other plugins
can first get their overrides of those handlers applied.
2016-06-16 17:21:49 +02:00
JC Brand
73bf2f88ea Bugfix. The rooms.get method didn't work properly
because the method it was delegating to was applicable to private chats only.
2016-06-16 17:20:11 +02:00
JC Brand
70f1570984 Bugfix. If controlbox is not there, undefined is returned.:wq 2016-06-16 17:15:27 +02:00
JC Brand
70135ba070 Add new config option notify_all_room_messages 2016-06-16 13:29:49 +02:00
JC Brand
249fb0fec5 Don't increment messages counter for MAM messages. 2016-06-16 10:39:08 +02:00
JC Brand
2c6f6bfef2 Merge branch 'soft-dependencie' 2016-06-13 07:45:15 +00:00
JC Brand
e2f1c68cff Always show the chat when calling 'open' 2016-06-13 07:36:59 +00:00
JC Brand
380a60aebd Two fixes related to occupants toggling
* Empty chat area doesn't resize when hiding occupants.
* Properly change icon when toggling occupants
2016-06-13 07:36:59 +00:00
amanzur
45a3e643a8 online users count issue-656 (#657)
* online users count issue-656

* change log entry added for issue 656
2016-06-10 16:27:28 +02:00
JC Brand
854633089d Add config setting to disable MUC direct invites. 2016-06-10 14:17:10 +00:00
JC Brand
6258cfa089 Check the "closed" state of the controlbox
when trimming chats.
2016-06-10 08:26:38 +00:00
JC Brand
1bf8b80cec Refactored converse-pluggable to remove all deferreds
by not attempting to load `optional_dependencies` via require.js.

Instead, we just expect them to be plugins and to have been loaded already.
2016-06-10 08:26:38 +00:00
JC Brand
454f8ef034 Let converse.initialize return a deferred
and use that in the tests, instead of a callback.
2016-06-10 08:26:38 +00:00
JC Brand
62c170273e Allow plugins to have optional dependencies.
This change refactors out the plugin code from converse-core into
src/converse-puggable.js

Additionally, plugins now have an optional attribute `optional_dependencies`
which is an array of dependencies which are "nice-to-have" but not essential.

Work has also been done to ensure that a plugins' dependencies are first loaded
before the plugin itself.
2016-06-10 08:26:29 +00:00
JC Brand
3ca6108083 Add controlbox back as dependency of MUC.
Will have to come up with some other way to disable it in cases where it's not
needed.
2016-06-06 20:52:05 +00:00
JC Brand
eb3252542e Split showChat into two methods to allow easier overriding. 2016-06-06 07:50:10 +00:00
JC Brand
600650a4c7 Let the headline plugin work without dragresize 2016-06-06 07:50:10 +00:00
JC Brand
5b80d67a98 Return before trying to extend the object
when strict_plugin_dependencies is set to `false`.
2016-06-03 19:25:09 +02:00
JC Brand
66242fc2f2 Remove the controlbox as a dependency of converse-muc. 2016-06-03 18:47:23 +02:00
JC Brand
1b8ab4c4ec Refactor code into insertIntoDOM method
To make overridding it easier.
2016-06-03 13:56:00 +02:00
JC Brand
6c99c51c74 New API method converse.rooms.close(). 2016-06-03 08:41:13 +00:00
JC Brand
f60a0512d9 Emit an event when the roster is fetched from the cache
We already emit an event when the roster is fetched from the XMPP server,
similarly, it would be useful to know when the roster was instead fetched from
the cache.
2016-06-01 16:04:06 +00:00
JC Brand
f9528e7144 Pass the jid to restore
if it's defined, then we want the extra check that the jids match, otherwise
we might be attaching to someone else's session.
2016-05-31 12:25:09 +00:00
JC Brand
0002c0bd53 converse._tearDown shouldn't be called from converse-controlbox.js 2016-05-31 10:24:22 +00:00
JC Brand
7398d41405 Some improvements to constructPresence
Don't <show> 'offline'.
Only include status_message when explicitly passed in as a string.
2016-05-31 09:40:18 +00:00
JC Brand
f70a3c3ed2 Add new configuration variable: default_state 2016-05-31 09:37:42 +00:00
JC Brand
2805bf8020 Add log method to API. 2016-05-31 07:20:36 +00:00
JC Brand
b4aeb94279 Don't use sound/desktop notification for OTR messages. 2016-05-30 18:19:10 +00:00
JC Brand
6bfcce5fcb Don't ignore incoming messages from current JID
they might be MAM archived messages.

Fixes #650
2016-05-30 17:30:14 +00:00
JC Brand
2b88db812d Don't show "new messages" indicator for archived messages 2016-05-30 17:18:07 +00:00
JC Brand
a050015e61 Add processing hints to chat state notifications
So that they're not stored in MAM.
2016-05-30 16:53:31 +00:00
JC Brand
bd23a7751a Add processing hints to OTR messages
so that they're not stored in MAM and not forwarded.

updates #553
2016-05-30 16:52:26 +00:00
JC Brand
5993fba1d4 Fix MAM issue. Messages weren't being queried for properly
because the archive ids of messages weren't being stored.
2016-05-30 16:19:05 +00:00
JC Brand
128317692d Wasn't explicitly scrolling down if the chat was already visible. 2016-05-30 14:32:05 +00:00
JC Brand
d9a2c1623f Make new msgs indicator clickable in chat rooms 2016-05-30 09:45:39 +00:00
JC Brand
848126638e Make the new msg indicator clickable 2016-05-28 12:25:44 +00:00
JC Brand
b6fcc9b79d Don't render unescaped urls. 2016-05-28 11:28:32 +00:00
JC Brand
5a1b308edd Render images from URLs 2016-05-28 11:13:49 +00:00
JC Brand
c738d085c4 Indicate to the user when there are unread messages
further down in the chat box.
2016-05-28 10:07:11 +00:00
JC Brand
82ee7f694e Don't ignore messages sent to different resource
But make this behavior configurable. Updates #647
2016-05-28 06:36:24 +00:00
Kamran
b82e0f3136 Fix for issue #648 (#649)
* Updated onDisconnected method to fire disconnected event. Issue #648

* Updated docs/CHANGES.md
2016-05-28 00:31:58 +02:00
JC Brand
619d970f25 Scroll down on <subject> messages.
Also, don't call scrollDown unnecessarily in showStatusMessages
2016-05-27 12:53:07 +00:00
JC Brand
032fe0d417 always scroll down when user sends a message 2016-05-27 12:42:31 +00:00
JC Brand
bbc23764e7 Initial work on keeping track whether the user scrolled
so that we don't scroll down while the user is reading messages further up.
2016-05-27 10:07:43 +00:00
JC Brand
e923fbf2d1 Set i18n to empty obj in cases where there's no locales
This lets variable interpolation still work (if Jed is loaded)
2016-05-26 13:02:53 +02:00
JC Brand
22041b3d7f Bugfix, room subject wasn't being shown. Also added a test for it. 2016-05-25 09:22:27 +00:00
JC Brand
7b006f31d4 Fix failing test.
When sending a MUC message, fullname should be the user's nick in the chat room.
2016-05-25 09:00:25 +00:00
JC Brand
2473fb133a On 2nd thought, don't query the msg text
I'm afraid it might get very expensive.
2016-05-25 08:31:35 +00:00
JC Brand
29c2a96481 Bot message doesn't appear when it has the same id as its command 2016-05-25 07:54:58 +00:00
JC Brand
aaaacf2513 Also show the day for the first received messages.
Until now, new days were only indicated for messages received on different days
*after* the day's messages.
2016-05-25 06:24:42 +00:00
JC Brand
cb288341fb Bugfix. Login form doesn't render after logging out
when auto_reconnect = false
2016-05-24 09:03:41 +00:00
JC Brand
6550544b41 Bugfix. Bind to right context. 2016-05-24 08:41:59 +00:00