Commit Graph

1653 Commits

Author SHA1 Message Date
JC Brand
ec5a57b9d2 Remove unnecessary btn class 2018-05-14 13:49:04 +02:00
JC Brand
2a7c6142a5 Use newer classes 2018-05-14 13:49:04 +02:00
ChaosKid42
4bdc9636b4 another fix for IE11 (#1102) 2018-05-13 12:39:16 +02:00
ChaosKid42
63764a7d51 fix selected values in list-multi form fields (#1101) 2018-05-12 16:45:40 +02:00
JC Brand
a33b451b73 Bugfix. Messages were losing followup class when re-rendered 2018-05-12 12:09:17 +02:00
JC Brand
ea60f190aa Bugfix. Check if chatbox exists 2018-05-12 10:57:40 +02:00
JC Brand
04e948ad67 Fix build error by setting dependency 2018-05-11 19:56:32 +02:00
JC Brand
8908ab5c7d We no longer user the inVerse branding 2018-05-11 13:50:19 +02:00
JC Brand
72001cb9df updates #1100 More jsdoc docstrings 2018-05-11 13:42:35 +02:00
JC Brand
38499917a9 updates #194
Include entity capabilities hash in outgoing presences

Also, started some work on using jsdoc for rendering API documentation.
Ideally that would go into a separate commit but that would take ages to
untangle.
2018-05-11 13:35:27 +02:00
JC Brand
ab1c19a974 Update markup to fit the mockup 2018-05-11 10:29:56 +02:00
JC Brand
d871392039 updates #1094
Update the occupants list when occupants are added/removed from the
member lists.
2018-05-11 00:17:44 +02:00
JC Brand
f573c69d08 updates #1094
Refetch the members lists when adding a new member via invite
2018-05-10 23:48:09 +02:00
JC Brand
f011078805 Handle case where we don't have a nick for an absent occupant
updates #1099
2018-05-10 23:28:03 +02:00
JC Brand
527555badf Add missing spec file 2018-05-10 23:24:43 +02:00
JC Brand
09db3eddb0 Add tests for contact removal via modal 2018-05-10 22:15:23 +02:00
JC Brand
21741649e4 Don't hide close button for chats
I find it useful to be able to close them
2018-05-10 21:29:05 +02:00
JC Brand
d16bb315aa Add the ability to remove a contact via the details modal 2018-05-10 18:04:17 +02:00
JC Brand
65ac389625 Add a way to show a user's vcard 2018-05-10 14:10:03 +02:00
JC Brand
2845d84b98 Remove debugging code 2018-05-09 14:35:05 +02:00
JC Brand
9bc21741fc Update mockup and CSS accordingly 2018-05-09 12:57:50 +02:00
JC Brand
859bc0616e Fixes #1094
- Show users who are registered on the different members lists
- Show badges indicating user's roles and affiliations
2018-05-09 12:28:34 +02:00
JC Brand
28ec15094e Add alert modal and close profile modal on save 2018-05-09 10:09:42 +02:00
JC Brand
64754fa33a Fix class name for icon 2018-05-09 09:27:21 +02:00
JC Brand
b6692b17a2 Show roles from VCard next to name in messages 2018-05-08 19:51:56 +02:00
JC Brand
8bd968a03b Also use the VCard cache for the user's own status 2018-05-08 19:24:50 +02:00
JC Brand
708b1dbe99 fixes #337
It's now possible to set your VCard via the UI and via the API
2018-05-08 18:14:56 +02:00
JC Brand
6c513ad4be Remove dependency on strophe's vcard plugin 2018-05-08 18:11:56 +02:00
JC Brand
2d5e8262e9 Create new builds 2018-05-07 18:24:24 +02:00
JC Brand
30c9a878ca Bugfix. Make sure nick is shown for sent messages 2018-05-07 18:22:45 +02:00
JC Brand
b3619077f9 Remove dependency on the strophe disco plugin
And instead implement it ourselves.

This solves a bug with that plugin whereby the connection handlers are
added to early and are therefore never fired.

Also fixed a problem whereby entity items are queried for features
before the features have been fetched.
2018-05-07 18:06:50 +02:00
JC Brand
5136b0c1dd Fix two failing tests (and a bug) 2018-05-07 14:31:02 +02:00
JC Brand
e6ba62d804 Avoid creating unnecessary messages 2018-05-07 13:50:07 +02:00
JC Brand
bbf33a8e4f Combine duplicate queryForArchivedMessages methods 2018-05-07 13:49:32 +02:00
JC Brand
dbee62c794 Do disco check in fetchArchivedMessages
so that it's applied in all cases where archived messages are fetched.
2018-05-07 13:14:58 +02:00
JC Brand
d42b872795 Check if room supports MAM before qyerying
instead of wrongly checking the bare JID
2018-05-07 13:07:44 +02:00
JC Brand
776f49d5c3 Bugfix. Don't remove model, simply remove view
Otherwise the model gets removed mid-creation, which causes the
`url required` error from Backbone.
2018-05-07 12:57:05 +02:00
JC Brand
7e94f3c691 Bugfix. Send model instance to event listeners
So that we can call `getDisplayName`
2018-05-07 10:58:58 +02:00
JC Brand
b8679063c5 Use the VCards collection for roster contacts
Instead of saving the vcard data on the contact model itself
2018-05-05 20:51:14 +02:00
JC Brand
e5cfdca30d Move roster models into their own module 2018-05-05 20:16:23 +02:00
JC Brand
09c55ebc28 Remove the use_vcards settings
VCards will now always be used.
2018-05-04 22:50:41 +02:00
JC Brand
6ac1df43e1 Render chat state notifications on the message view
and not via the chatbox view (fixes some failing tests also).
2018-05-04 17:26:43 +02:00
JC Brand
99915a26f4 Use vcard from the collection for rendering messages 2018-05-03 20:05:45 +02:00
JC Brand
adf34c845c Render chatbox avatar via the vcards collection 2018-05-03 19:01:57 +02:00
JC Brand
71ed5bbdd1 Don't set vcard on the chatbox model 2018-05-03 18:44:02 +02:00
JC Brand
16b2a1b2a9 Avatar/VCard refactoring
- Refer to VCards instead of Avatars where appropriate
- Fetch VCards for non-groupchat messages as well
2018-05-03 18:34:28 +02:00
JC Brand
d5c8acea04 Create avatar objects for all messages, not just groupchat 2018-05-03 18:24:24 +02:00
JC Brand
e77f627432 Remove unused code, fix build path and update package-lock.json 2018-05-03 18:22:54 +02:00
JC Brand
df948a8dd6 Also allow a single-user chat to be embedded into the page 2018-05-03 17:01:17 +02:00
JC Brand
4c15ac2e8c Add new config setting: auto_join_private_chats 2018-05-03 16:36:02 +02:00
JC Brand
3fe2ff234e Fixes #1088
Entity items weren't being fetched from cache.

Apparently this bug only surfaced because with Ejabberd the upload
service is nested one level deeper than with Prosody.
2018-05-03 15:48:32 +02:00
JC Brand
01a88c24a8 Refetch avatar when occupant's photo hash has changed 2018-05-03 14:50:27 +02:00
JC Brand
7660a27682 Store image hash from presence on the occupant 2018-05-03 13:50:30 +02:00
JC Brand
8c3f379d82 Calculate and save avatar hash upon receipt 2018-05-03 13:44:52 +02:00
JC Brand
d49adc9309 Doesn't look like its necessary to call initConnection again 2018-05-03 11:13:08 +02:00
JC Brand
c25de7bd4c Bugfix. initAvatars wasn't being called. 2018-05-03 11:13:00 +02:00
JC Brand
c18eaa3351 pluginsInitialized is too early
we don't yet have a connection then, so listen to
`connectionInitialized` instead.
2018-05-02 16:19:12 +02:00
JC Brand
a52e24adc8 Fixes #1087 2018-05-02 15:40:47 +02:00
JC Brand
cb0d8c7d86 Found more MUC code that should be in the view module 2018-05-02 15:29:06 +02:00
JC Brand
ca0f5fcfef Fix bookmark item markup
so that `hidden` class gets applied to the right element
2018-05-02 15:16:56 +02:00
JC Brand
7eb6b13f10 Don't mark /me messages are followup messages. 2018-05-02 14:55:10 +02:00
JC Brand
911ede2886 Small bugfixes.
- Filter did the opposite of what it was supposed to do
- Wrong bind context
- Should actually be mam:2, issue was server misconfiguration
2018-05-02 14:30:14 +02:00
JC Brand
dd505ad9da More fixes now that we don't store the JID under 'fullname'
if the fullname is not available.
2018-05-01 20:07:56 +02:00
JC Brand
cbc48629f1 Clear canvas before redrawing 2018-05-01 19:55:26 +02:00
JC Brand
afc924fd72 Bugfix. Since refactoring we do want onMessage to handle MAM messages 2018-05-01 19:46:18 +02:00
JC Brand
0e61eda620 Fix typo, fixes MAM again :) 2018-05-01 18:47:43 +02:00
JC Brand
31982aab0b Store MUC avatars globally, not per chatroom
This allows us to cache them for longer.
2018-05-01 18:30:05 +02:00
JC Brand
53f5627b72 Add support for rendering avatars in groupchats 2018-05-01 18:18:02 +02:00
JC Brand
c14ef3bb75 Bugfix. Can't expect fullname to be set anymore. 2018-05-01 15:21:20 +02:00
JC Brand
b5a516e044 Add new api method vcard.update 2018-05-01 14:59:02 +02:00
JC Brand
f9aa75b69e Refactored message attributes and rendering.
- set `username` on the message object,
  instead of always using `fullname` with fallback to `jid`.
- Distinguish better between `groupchat` messages and normal
  messages in `getMessageAttributesFromStanza`
2018-05-01 12:30:58 +02:00
JC Brand
54cafb1243 Update vcard.get API method to accept either a JID string or a model 2018-05-01 11:45:12 +02:00
JC Brand
097d992d13 Bugfix, /me message wrongly marked as followup message. 2018-04-30 16:23:52 +02:00
JC Brand
eaf65f4d24 Add missing items-list class (as per mockup) 2018-04-30 15:37:37 +02:00
JC Brand
4f7c08b1da Bail when in a callback for a hanging chatroom 2018-04-30 15:37:37 +02:00
JC Brand
4bcf8e7bc3 Mark followup messags so that they can be styled differently 2018-04-30 15:37:37 +02:00
JC Brand
60c784a39e Ensure that default image is used for avatars.
By overriding the `set` method.
2018-04-30 15:37:37 +02:00
JC Brand
8fd65487c7 Use safeSave to avoid intermittent test failures
due to asynchronous events.
2018-04-30 15:37:37 +02:00
JC Brand
876a07b3de Fix the failing tests 2018-04-30 15:37:37 +02:00
JC Brand
1405d9cb49 Also style file upload and action messages. 2018-04-30 15:37:37 +02:00
JC Brand
209bac4b5e Use uri.js to identify URLs in message text. 2018-04-30 15:37:37 +02:00
JC Brand
5ffb09bd15 Updates #161: Treat sent files also as oob messages 2018-04-30 15:37:37 +02:00
JC Brand
36ccb4618f Tweak chatroom headings 2018-04-30 15:37:36 +02:00
JC Brand
56e4e8b8ee Fix rendering of headline messages.
Also, add urijs to more intelligently handle URIs
2018-04-30 15:37:36 +02:00
JC Brand
3d42425083 Some UI improvements
- Render images as thumbnails
- Use the image.html template when rendering images from pasted URLs
- Update message and spoiler markup to render avatars
- Use the default avatar as fallback when user doesn't have one
- Instead of 'me' render own name or JID
2018-04-30 15:37:36 +02:00
JC Brand
57f7e31aa1 Add a spoiler message to the mockups 2018-04-30 15:37:36 +02:00
JC Brand
aa6a739cfa Initial work on showing avatars in messages.
- Update the mockups to show avatars.
2018-04-30 15:37:36 +02:00
JC Brand
6cce931086 Make sure show is created on all chatbox types 2018-04-24 16:39:39 +02:00
JC Brand
fb11cfe795 Add converse-embedded class without requiring an override 2018-04-24 14:35:47 +02:00
JC Brand
76a47829cd Optimize keyPressed slightly 2018-04-24 14:35:29 +02:00
JC Brand
7807b19905 Debounce show similarly to other methods 2018-04-24 14:34:19 +02:00
JC Brand
71be72b50c Automatically grow/shrink input as text is entered/removed 2018-04-24 14:33:00 +02:00
JC Brand
59a72efe1b Refactor MUC message sending
To make it more similar to how messages are sent in private chats and to
reuse methods as far as possible.

Removed `sendChatRoomMessage` and `clearChatRoomMessages`
2018-04-24 11:09:36 +02:00
JC Brand
9a410c6a96 updates #161 Proper error messages and include server response 2018-04-24 10:09:45 +02:00
JC Brand
e0aaeb66ea updates #161
* Fix typo which broke MUC file upload
* Remove unused method
* Move file input into li element
2018-04-24 07:49:37 +02:00
JC Brand
a15c9e54d0 Also test for when XEP-0363 is not supported
Updates #161
2018-04-22 17:47:34 +02:00
JC Brand
aacfe3b66b Don't show MUC CSN if from myself. fixes #1026 2018-04-22 04:26:35 +02:00
JC Brand
74f9952b24 Move sendChatState methods to the models 2018-04-22 04:25:05 +02:00
JC Brand
2850ef0485 Don't show delayed chat state notifications 2018-04-22 04:09:24 +02:00
JC Brand
a19e7aeffe Add support for XEP-0066 Out of band data 2018-04-18 16:58:52 +02:00
JC Brand
d048cff9a8 Provide metadata of file being uploaded.
updates #161
2018-04-18 11:49:53 +02:00
JC Brand
133df99aec Honor the filesize restrictions of the XMPP server
updates #161
2018-04-18 11:35:33 +02:00
JC Brand
076ace3fad Parse and save jabberdata formdata from a disco#info result 2018-04-17 16:42:20 +02:00
JC Brand
c01e9f8265 Move methods from chatbox view to message view
Specifically the methods related to requesting an upload slot and uploading a file.
Also show a progress indicator while a file is being uploaded.

Updates #161
2018-04-17 15:21:38 +02:00
JC Brand
db790183d8 Remove unused code 2018-04-17 15:21:38 +02:00
JC Brand
dad8eb2f48 Remove separate file converse-http-file-upload
It contained only `overrides` and some HTTP upload code was in other
modules.

Current thinking concerning overrides:

Usage of `overrides`, while useful in certain cases, should in general
be discouraged, since it's in essence "monkey patching" which makes it
more difficult to know whats executing at runtime and more difficult to
refactor.

Splitting modules up between XEPs is not always that useful. Some XEPs,
like HTTP Upload (and MAM comes to mind) have their functionality spread
out over single and group chats (and pubsub) and might for practical
purposes be considered "core" enough to not try and keep them in
separate modules (which inevitably requires overrides or a fundamentally
rethinking the architecture).

Where splitting code between modules makes a lot of sense is in keeping
Backbone Models and Views separate (so that alternative view libraries
like Vue could be used) and probably in keeping Single chats, MUC,
PubSub and MIX separate.

updates #161
2018-04-17 15:21:30 +02:00
JC Brand
de6ecbf07a Render messages via a new MessageView view
updates #161
2018-04-17 15:21:26 +02:00
JC Brand
264e6830af Remove references to unused parameters
updates #161
2018-04-17 15:21:21 +02:00
JC Brand
6cab7fcc41 Fix failing tests due to refactoring
updates #161
2018-04-17 15:21:16 +02:00
JC Brand
584f293d05 Updated and refactored the work from @worlword
* Use Promises instead of callbacks
* Update to latest (Last Call) version of XEP-0363
* Move non-view specific methods to models instead
* Add more tests

updates #161
2018-04-17 15:21:09 +02:00
JC Brand
9c2a5bd3b8 Merge branch 'worlword-httpFileUpload' into http-file-upload 2018-04-14 07:50:29 +02:00
JC Brand
042c1947ed Add file-upload button 2018-04-14 07:40:07 +02:00
JC Brand
a9d2881888 Fix disco hierarchy
Previously we kept all entities and their items (which are also
instances of _converse.DiscoEntity) in a flat array.

Instead, we should have a tree-like structure where items are stored
on the relevant entity (and recursively on other items).
2018-04-14 07:36:24 +02:00
JC Brand
77a51cc2a6 Initial work on XEP-0363: HTTP File Upload 2018-04-14 07:36:24 +02:00
worlword
3b1d27636d problem fixed, that file-upload would not start. Also did some code cleanup 2018-04-13 11:45:43 +02:00
worlword
ca40cf6541 removed EmptyLines in ChatView.js and Change Lineendings to LF in toolbar_fileUpload.html 2018-04-12 09:37:58 +02:00
worlword
bf3e6f2363 some code-changes to align with the coding standard 2018-04-12 09:24:41 +02:00
worlword
7660dbfb31 merge httpFileUpload-Branch with master 2018-04-12 07:43:39 +02:00
JC Brand
3d29567ab6 Revert "Don't show typing from different device CSN messages"
This reverts commit 7303e96cdb.

Instead of dropping the feature entirely, we can check if the CSN is a
carbon message.
2018-04-11 18:46:50 +02:00
worlword
c9a9d01112 used code from 'http-file-upload' branch. Buttons are now added to the toolbars through converse-http-file-upload.js. 2018-04-11 17:09:32 +02:00
worlword
fa80749658 refactoring based on the review from jcbrand 06.Apr.2018 2018-04-11 15:29:41 +02:00
JC Brand
7303e96cdb Don't show typing from different device CSN messages
To avoid showing them erroneously would mean keeping track of used
message ids which seems like more work than justified by the feature.

Fixes #1026
2018-04-10 20:56:54 +02:00
JC Brand
3d0435a755 Remove hack specific to the soon to be retired Slack XMPP gateway 2018-04-10 20:56:40 +02:00
JC Brand
9528d81c00 Move various MUC methods onto the Backbone.Model
To more cleanly separate views and models and to make MUC in headless
mode more viable.

Refs #1032
2018-04-10 18:59:02 +02:00
Kim Alvefur
a82f950e3c Put timestamp in a <time> tag for better semantics and easier styling 2018-04-07 21:47:22 +02:00
JC Brand
9a526d4194 Refactoring of the XEP-0085 Chat State Notifications code
* Distinguish between CSN messages and other types of messages
* Properly clear previous notifications
* Better handling of notifications from multiple users (in MUC)
* Rename methods to make clarify intent
2018-04-06 17:02:28 +02:00
worlword
7839f20846 fixed sendMessage for so that tests will work again 2018-04-05 08:45:58 +02:00
worlword
83c0d42ecf changed line-endings in converse-httpFileUpload.js 2018-04-04 16:03:44 +02:00
worlword
530e7f9d3f fixed file-upload-button in MUC and added changes.md entry 2018-04-03 12:29:12 +02:00
worlword
b23712aec3 added httpFileUpload to converse.js 2018-04-03 11:20:57 +02:00
JC Brand
e31373a6ae Fixes #1055 Wrong paths in build.js 2018-03-31 19:51:55 +02:00
ChaosKid42
fce9ee0db9 replace geoURIs (e.g. from Convesations) by links to openstreetmap (#1054)
* replace geoURIs by link to openstreetmap

* Added testcase
2018-03-31 18:29:01 +02:00
JC Brand
44a2f7807c Hook in ar and eu locales and document. 2018-03-31 15:45:23 +02:00
JC Brand
ebfd0a8f77 Move various funcitons related to MUC member lists to utils
and out of the MUC views plugin.

Refs #1032
2018-03-30 14:23:39 +02:00
JC Brand
06141b3212 Move methods from MUC view to model
* checkForReservedNick
* parseRoomFeatures
* sendConfiguration

Refs #1032
2018-03-30 14:23:39 +02:00
JC Brand
2705ec8193 Let the chatarea expand when the occupants sidebar is collapsed. 2018-03-30 14:23:39 +02:00
JC Brand
6a12a96e85 Fixes #1043 Parsing of bookmarks fail with missing nick element. 2018-03-30 14:23:39 +02:00
JC Brand
ce849aaffc Fix failing tests 2018-03-30 14:23:39 +02:00
JC Brand
d90416eae8 Add workaround for apparent Prosody bug
Details here: https://prosody.im/issues/1121
2018-03-30 14:22:53 +02:00
JC Brand
faaaa8139a Properly remove ContactView from the overview 2018-03-30 14:22:53 +02:00
JC Brand
93a20ee4ee Make sure removeFromRoster is called only once 2018-03-30 14:22:53 +02:00
JC Brand
b584f2efb3 Add a new config setting nickname
- for subscription requests
- when entering chat rooms
2018-03-30 14:22:53 +02:00
JC Brand
3354083934 Bugfix. Remove view for contact moved to different group
Otherwise the contact stays visible under "Pending Contacts" although
the subscription request has been accepted.
2018-03-30 14:22:53 +02:00
JC Brand
e8718ec3d3 Bugfix. Make sure group gets inserted
when it's created due to a new contact being added.

Was previously in the wrong place.
2018-03-30 14:22:52 +02:00
JC Brand
1029aae215 Write out map when calling create 2018-03-30 14:22:52 +02:00
JC Brand
c8f72b350b Disable vcard plugin is use_vcard is false 2018-03-30 14:22:52 +02:00
JC Brand
535fc7bc8d Use strings for map keys 2018-03-30 14:22:52 +02:00
JC Brand
9799ecce10 Focus inputs inside modals 2018-03-30 14:22:52 +02:00
JC Brand
0173d28f48 Clear "add contact" form after submission. 2018-03-30 14:22:52 +02:00
JC Brand
b9cdf6b71f Make sure relevant roster group gets inserted when a new contact gets added
by calling `sortAndPositionAllItems`.

Particularly relevant to the "Pending Contacts" group.
2018-03-30 14:22:52 +02:00