Commit Graph

86 Commits

Author SHA1 Message Date
JC Brand
877e07775a Remove need to pass in spies to initConverse
They aren't used anymore.
2019-10-11 17:46:13 +02:00
JC Brand
b63b080419 chatboxes: wait until messages are fixed before returning new chatbox
Fixes #1691
2019-10-10 14:44:13 +02:00
JC Brand
2b268c92bb Fix linting error 2019-10-09 17:08:28 +02:00
JC Brand
8780f7a128 Fix linting errors (no-unused-vars) 2019-10-09 16:27:58 +02:00
Licaon_Kter
a69ebcbdf6 Capitalize "groupchat" (#1707)
* Capitalize "groupchat"

* Also locale

* Also muc spec
2019-09-11 14:17:23 +02:00
JC Brand
90ef4b0c9d Don't let non-mods open the modtools modal
Bugfix: fall back to nick if the JID is not available.
2019-09-08 00:15:05 +02:00
JC Brand
4015eb2fd1 Name anonymous function to fix failing test 2019-09-05 13:12:34 +02:00
JC Brand
b5c56c8323 Add getFullname to XMPPStatus model and use that
instead of returning the fullname as fallback in `getNickname`
2019-09-05 12:49:10 +02:00
JC Brand
2c48096664 Add new spec with emoji tests 2019-08-22 13:56:47 +02:00
JC Brand
4cb9fd88a8 Refactor emojis so that JSON is fetch asynchronously 2019-08-22 13:56:47 +02:00
JC Brand
3faaf6a62b converse-muc: Fetch messages in the initialize method
Lately we've been fetching messages only after entering the MUC, so that
we already have occupants to attach to them (due to `fetchMembers` being
called before) and thereby avoid rerenders.

I've now moved message fetching into the `initialize` method and added
missing event handlers for attaching/removing the occupant from a
message as it comes online or goes offline.

We still avoid (some) rerenders because we fetch and wait for cached
occupants before fetching cached messages and we wait for `fetchMembers`
before triggering `enteredNewRoom` which causes MAM messages to be
fetched.
2019-08-14 11:08:05 +02:00
JC Brand
89ac4a6969 Show error message with option to retry when MAM query times out 2019-08-13 11:08:03 +02:00
JC Brand
aee6a192d1 Add a new command /modtools
in which you can set user affiliations and roles.

Also, let getAffiliationList return an Error instead of `null` if you're
not allowed to fetch a particular affiliation list.
2019-08-09 23:30:14 +02:00
JC Brand
bea073a5a2 Fix erroneous "is no longer an admin/owner" messages in MUCs
Don't remove affiliation for occupants if we weren't allowed to
fetch that particular affiliation list.

Previously, if fetching the list failed, we would return an empty array,
which would imply that the affiliation list is empty and that all
users with the given affiliation should have their affiliations removed.

Instead we now return `null` and properly account for that when setting
affiliations on existing contacts based on the returned member lists.
2019-08-08 16:19:04 +02:00
JC Brand
bda567ca01 Fix linting errors 2019-08-05 11:26:48 +02:00
JC Brand
7a590f7c22 Stop using certain lodash methods.
* _.isNil
* _.noop
* _.isNull
2019-08-05 10:56:22 +02:00
JC Brand
c7b6bb4773 Only clear messages when clear_messages_on_reconnection is true 2019-08-03 21:43:06 +02:00
JC Brand
cd392bb197 Fixes #1561 Don't clear localStorage and sessionStorage 2019-08-01 11:34:14 +02:00
JC Brand
1eb2364336 Let sendMessage return the message model, not just the text 2019-07-30 16:15:47 +02:00
JC Brand
c4ad02d4e3 New config setting: muc_fetch_members 2019-07-26 13:32:21 +02:00
JC Brand
9be43ccea7 Don't inform of role change which accompanies an affiliation change
given that it's implicit and can cause confusion
2019-07-22 18:45:30 +02:00
JC Brand
a1630b5c1f Replace wait-until-promise with utility method
and bump default timeout

Also let `_converse.api.waitUntil` use it if a function is passed in.
2019-07-11 23:34:27 +02:00
JC Brand
8a98ef87fe Various small fixes. (Unused imports, unused vars etc). 2019-07-11 12:37:17 +02:00
JC Brand
8a405ee88c Various bugfixes based on the previous refactoring.
These two commit should ideally be one, but I inadvertently pushed to
remote too early.
2019-07-10 16:55:55 +02:00
JC Brand
ded9945ed9 MUC: Don't send XEP-0085 CSNs when we don't have voice
Includes some refactoring:

- Don't send an `active` chat state notification when entering a MUC
  I can't think of a good reason why this might be necessary or desired.
- Move `setChatState` form the view to the model
- Remove unused method `handleChatStateNotification`
- Don't store `role` and `affiliation` for the current user on the
  ChatRoom object, but instead on the ChatRoomOccupant object representing
  the user.
2019-07-10 14:24:00 +02:00
JC Brand
e5188d8b10 Bugfix. Remove affiliation based on updated members lists 2019-07-04 08:28:12 +02:00
JC Brand
1a3526f537 Update openAndEnterChatRoom to take JID 2019-07-04 08:28:12 +02:00
JC Brand
67bcc00f10 Associate ChatRoomOccupant to ChatRoomMessage
and use promises to indicate when an occupant or contact has been set
2019-07-04 08:28:12 +02:00
JC Brand
bb94891621 Only remove non-members when reconnecting to a MUC
to avoid unnecessarily destroying and then recreating ChatRoomOccupant
instances for room members.
2019-07-01 09:16:15 +02:00
JC Brand
98215deb21 Update to latest backbone.overview which debounces sorting on add event 2019-06-27 13:15:55 +02:00
JC Brand
9ee0b68133 Fix failing test 2019-06-26 17:31:53 +02:00
JC Brand
e83b0ff39e Update wording to clarify what /revoke means 2019-06-25 16:59:00 +02:00
JC Brand
40469a9787 MUC: Refresh room features when re-entering a cached room
Only fetch messages after we have the latest room features
Otherwise we run into race conditions where MAM messages are fetched
before we know whether (updated) the room supports MAM or not.
2019-06-20 14:04:46 +02:00
JC Brand
36549bf61d Revert flexbox, column-reverse changes
Unfortunately this doesn't work on Firefox and there's no proper
workaround. https://github.com/philipwalton/flexbugs/issues/108

Reverts:

Revert "Bugfix. Properly insert error messages and spinner"
This reverts commit 6a419cc145.

Revert "Use flexbox to keep the chat scrolled down"
This reverts commit dd91d3cc55.
2019-06-19 11:45:54 +02:00
JC Brand
4f67f352f5 Fix /${command} parsing bug 2019-06-18 13:01:38 +02:00
JC Brand
dd91d3cc55 Use flexbox to keep the chat scrolled down
By using `display: flex` and `flex-direction: column-reverse`, the chat
now automatically scrolls down when loaded, without requiring any
extra JavaScript.

We still need to scroll down with JavaScript when sending a message.

By using `column-reverse`, the messages container now works in reverse.
So the newest message is the first element in the container and the
oldest message is the last. This is the reverse of before.

Due to this, this change will likely break some plugins.
2019-06-18 11:37:07 +02:00
JC Brand
ba9d28b5c2 Two MUC tests
- Test for info message indicating a configuration change
- Test that the MUC reconnects when a `not-acceptable` error is returned
2019-06-12 18:39:24 +02:00
JC Brand
bbe2a62295 converse-muc: Create info and error messages on the model
instead of on the view.
2019-06-12 06:27:07 +02:00
JC Brand
737e27c726 Use shakespearean character names in tests 2019-06-03 09:43:24 +02:00
JC Brand
e362776b9f converse-muc-views: Don't prematurely insert MUC into the DOM 2019-05-31 09:14:42 +02:00
JC Brand
e053b97043 Set room `connection_status' to DISCONNECTED...
when receiving an `unavailable` presence for ourselves.
2019-05-28 14:30:55 +02:00
JC Brand
fcc9e8c31b Also allow @ in moderator commands 2019-05-27 12:27:24 +02:00
JC Brand
be0274f1f0 Fixes #1586. Not possible to kick someone with space in nick
Refactored moderation by moving certain methods to the model and
consolidating setting of roles and affiliations into new methods.
2019-05-27 12:27:12 +02:00
JC Brand
5e6c2b9982 Move role modifying method to the model
and also first check whether we have an occupant with that nickname.

Since roles are session based, it doesn't make any sense to try to
modify the role for a user not in the room.
2019-05-27 12:27:03 +02:00
JC Brand
e1762a1bb5 Rename key event handler methods to avoid confusion 2019-05-26 11:09:43 +02:00
JC Brand
9cb9151265 Add test to check that #1577 is resolved 2019-05-21 12:05:47 +02:00
JC Brand
d1d81bf933 Bugfix. Remove condition before fetching members 2019-05-21 11:33:01 +02:00
JC Brand
a95bb5b26a Refactor tests so that IQ_ids always contains only XML stanzas 2019-05-20 14:37:29 +02:00
JC Brand
7e515dd4b1 Move all MUC joining logic to the model 2019-05-20 10:06:37 +02:00
JC Brand
46fef28601 Clear messages when closing a chat 2019-05-19 22:11:37 +02:00