Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
260 commits
Select commit Hold shift + click to select a range
b9bc8ee
Typo
Feb 2, 2017
300cd96
Add glue code to make react-sdk use indexedDB
kegsay Feb 2, 2017
efae5f6
Use localStorage team token with fall-back on query parameter
Feb 3, 2017
173e80a
Get team_token from the RTS on login
Feb 3, 2017
fd0a66a
Unpin js-sdk
richvdh Feb 3, 2017
4f3549c
Fix: actually get the team token
Feb 3, 2017
6d8dcd9
Merge branch 'master' into develop
richvdh Feb 4, 2017
77f76db
UserSettings: s/vector-web/riot-web/
richvdh Feb 6, 2017
484d9d7
Logging to try to track down riot-web#3148
richvdh Feb 6, 2017
c0d2fe1
Merge pull request #677 from matrix-org/rav/logging_for_send_fail
dbkr Feb 6, 2017
af19ea8
Document login API
Feb 7, 2017
c93b6c3
Style, fixes
Feb 7, 2017
d5f6ecd
Use teamToken, not config when doing screen fallback
Feb 7, 2017
96539a4
Merge pull request #666 from matrix-org/luke/rts-welcome-pages
dbkr Feb 7, 2017
3f9f59b
Import RtsClient at top
Feb 7, 2017
3d30db8
Only init RTS if configured correctly
Feb 7, 2017
8fea4c2
fix NPE
ara4n Feb 7, 2017
fe17e24
Merge pull request #676 from matrix-org/luke/rts-team-token-login
dbkr Feb 8, 2017
260cb62
Do not set team_token if not returned by RTS on login
Feb 8, 2017
c2d5b72
Set referrer qp in nextLink
Feb 8, 2017
f1288d8
Merge pull request #678 from matrix-org/luke/rts-fix-undefined-team-t…
dbkr Feb 8, 2017
449519d
Merge pull request #679 from matrix-org/luke/rts-email-verif-referrer
lukebarnard1 Feb 8, 2017
231997d
unbreak /markdown off
ara4n Feb 9, 2017
ea50acf
fix dark theme for uploadbar
ara4n Feb 9, 2017
ad2710e
fix CSS for import/export buttons
ara4n Feb 9, 2017
747c0c4
Use new method of getting team icon
Feb 9, 2017
4065849
Consider emails ending in matrix.org as a uni email
Feb 9, 2017
cc69e98
Use single state to set both avatars and typing notif
Feb 9, 2017
5530544
Use (props,state) ordering of arguments
Feb 9, 2017
1037107
Do not show "+1 other"
Feb 9, 2017
dd22e57
Merge pull request #681 from matrix-org/luke/rts-matrix-org
lukebarnard1 Feb 9, 2017
7ba9e27
Merge pull request #682 from matrix-org/luke/fix-typing-notif
dbkr Feb 9, 2017
ae03244
Merge branch 'develop' into luke/feature-css-msg-colors
lukebarnard1 Feb 9, 2017
69add8f
Actually use the RTS URL
Feb 9, 2017
8d3876c
MELS: either expanded or summary, not both
Feb 9, 2017
45f5b8b
Thread teamToken through to LeftPanel for "Home" button
Feb 10, 2017
8bd7d90
Merge pull request #684 from matrix-org/luke/rts-thread-teamToken
dbkr Feb 10, 2017
bab6a0b
Persist query parameter team token across refreshes
Feb 10, 2017
ec73005
Alter comment
Feb 10, 2017
a5a43bc
Merge pull request #685 from matrix-org/luke/rts-session-team-token
lukebarnard1 Feb 10, 2017
407bcf1
Delete database on logout. DI a SyncAccumulator. Log uncaught errors
kegsay Feb 10, 2017
bdd031e
Enable branded URLs again by parsing the path client-side
Feb 10, 2017
f628ee2
Merge branch 'develop' into kegan/indexeddb
kegsay Feb 10, 2017
c46f282
Comments
kegsay Feb 10, 2017
33fc4f7
Merge pull request #680 from matrix-org/luke/rts-fix-reg-icon
dbkr Feb 10, 2017
29f5e88
Instead of sending userId, userEmail, send sid, client_secret
Feb 10, 2017
4ac7691
View /home on registered /w team
Feb 10, 2017
75deb55
Null check on teamName
Feb 13, 2017
b45da45
Merge pull request #686 from matrix-org/luke/rts-enable-branded-urls
dbkr Feb 13, 2017
a21e71f
Merge pull request #688 from matrix-org/luke/rts-use-sid-client-secret
lukebarnard1 Feb 13, 2017
16e3365
Use a callback prop instead of `window.`
Feb 13, 2017
79d9deb
Split out InterActiveAuthDialog
dbkr Feb 13, 2017
77b2266
Copyright
dbkr Feb 13, 2017
8fc3104
Replace submit button with a spinner when busy
dbkr Feb 13, 2017
36d126f
PR feedback
dbkr Feb 13, 2017
18cba1f
Merge pull request #689 from matrix-org/luke/rts-set-team-token-view-…
dbkr Feb 14, 2017
ba3e62e
Remove old docs
dbkr Feb 14, 2017
43a740d
Add busy param to docs
dbkr Feb 14, 2017
17b08ae
Merge pull request #691 from matrix-org/dbkr/interactive_auth_nondialog
dbkr Feb 14, 2017
6996291
Store retrieved sid in the signupInstance of EmailIdentityStage
Feb 14, 2017
0e08646
Merge pull request #692 from matrix-org/luke/fix-missing-sid
lukebarnard1 Feb 14, 2017
1b8e93d
Treat the literal team token string "undefined" as undefined
Feb 14, 2017
76f80e9
Merge pull request #693 from matrix-org/luke/fix-team-token-undefined
lukebarnard1 Feb 14, 2017
8001c0b
Add confirmation dialog to kick/ban buttons
dbkr Feb 14, 2017
689972f
Copyright
dbkr Feb 14, 2017
ff61b76
Fix imports
dbkr Feb 14, 2017
5e232d8
Argh, ES6 import syntax
dbkr Feb 14, 2017
0303a42
Fix typo with Scalar popup
Feb 14, 2017
a1c990a
Make ban either ban or unban
dbkr Feb 14, 2017
ec0ce76
Clarify docs
dbkr Feb 14, 2017
6663f5b
Remove commented stuff
dbkr Feb 14, 2017
f38b2de
Convert some missed buttons to AccessibleButton
dbkr Feb 14, 2017
3d4a831
Merge pull request #695 from matrix-org/luke/fix-scalar-popup
lukebarnard1 Feb 14, 2017
6fc7041
s/onBan/onBanOrUnban/
dbkr Feb 14, 2017
973b92b
Merge pull request #694 from matrix-org/dbkr/confirm_ban
dbkr Feb 14, 2017
e1cb34e
Merge remote-tracking branch 'origin/develop' into dbkr/missed_access…
dbkr Feb 14, 2017
87516fb
Add a button to un-ban users in RoomSettings
dbkr Feb 14, 2017
1e1ae5c
Merge pull request #696 from matrix-org/dbkr/ban_becomes_unban
dbkr Feb 14, 2017
431e7a8
Copyright
dbkr Feb 14, 2017
a5325ee
Merge pull request #697 from matrix-org/dbkr/missed_accessiblebuttons
richvdh Feb 15, 2017
42bb269
Merge branch 'develop' into dbkr/add_unban_button
richvdh Feb 15, 2017
8067bb6
Display avatar initials in typing notifications
Feb 15, 2017
c082827
Fix docs & use WithMatrixClient
dbkr Feb 15, 2017
a5a0562
Revert c082827fc7e3e11e4790c0306933c751c7a09c65
dbkr Feb 15, 2017
8698d40
Fix docs & add MatrixClient check
dbkr Feb 15, 2017
bdb8f9d
Don't force-logout the user if reading localstorage fails
richvdh Feb 15, 2017
5769213
Merge pull request #700 from matrix-org/rav/no_logout_on_localstorage…
richvdh Feb 15, 2017
ebe7ec4
Rename RTE labs option to "New Composer & Autocomplete"
aviraldg Feb 15, 2017
74487c6
If a referrer hasn't been specified, use empty string
Feb 16, 2017
1f77534
Merge pull request #701 from matrix-org/luke/rts-allow-non-referrals
dbkr Feb 16, 2017
0e66b37
fix eslint's no-invalid-this rule for class properties
aviraldg Feb 16, 2017
f07da44
Don't handle logs db: It needs to close its connections first
kegsay Feb 16, 2017
fe4a28b
Merge pull request #703 from aviraldg/fix-no-invalid-this
dbkr Feb 16, 2017
6945e7c
Merge pull request #699 from matrix-org/luke/fix-avatar-initials
lukebarnard1 Feb 16, 2017
53f3b57
Merge branch 'develop' into kegan/indexeddb
kegsay Feb 16, 2017
9d2bb70
If the home page is somehow accessed, goto directory
Feb 16, 2017
406c34b
Make UserSettings use the right teamToken
Feb 16, 2017
b13e6ca
Merge pull request #705 from matrix-org/luke/rts-default-goto-directory
dbkr Feb 16, 2017
4753552
Merge pull request #706 from matrix-org/luke/fix-team-token-referral-…
dbkr Feb 16, 2017
cca266c
Review comments
kegsay Feb 17, 2017
b2344ce
Update the room view on room name change
dbkr Feb 17, 2017
cc11b3e
Merge pull request #687 from matrix-org/kegan/indexeddb
kegsay Feb 17, 2017
97722af
Merge pull request #698 from matrix-org/dbkr/add_unban_button
richvdh Feb 17, 2017
a3746ea
Merge remote-tracking branch 'origin/develop' into dbkr/update_on_roo…
dbkr Feb 17, 2017
775834b
Merge pull request #707 from matrix-org/dbkr/update_on_room_name
dbkr Feb 17, 2017
0a31efa
Add a 'Clear Cache' button
kegsay Feb 17, 2017
8d6c3cd
Review comments
kegsay Feb 17, 2017
de4773b
Show when you've been kicked or banned
dbkr Feb 17, 2017
5abcb91
Merge pull request #708 from matrix-org/kegan/clear-cache
kegsay Feb 17, 2017
9f9de46
Add onForgetClick proptype
dbkr Feb 17, 2017
a3aea6b
Swap rejoin / forget
dbkr Feb 17, 2017
1f5fdf7
Get a member object, not the user object
dbkr Feb 17, 2017
b18473c
Handle there being no member event when banned
dbkr Feb 17, 2017
10534e7
Merge pull request #709 from matrix-org/dbkr/show_when_banned
dbkr Feb 17, 2017
db4b969
Support reasons for kick / ban
dbkr Feb 17, 2017
3fcea0f
Merge pull request #710 from matrix-org/dbkr/support_kick_ban_reasons
dbkr Feb 17, 2017
4f4e9a6
Fix block quotes all being on a single line
dbkr Feb 17, 2017
1819ff0
Un-hardcode home in jenkins.sh
dbkr Feb 17, 2017
e79d384
Oops, un-hardcode correctly
dbkr Feb 17, 2017
5ac76ac
limit avatar uploads to images
ara4n Feb 19, 2017
8990e77
fix colouring in voip dark theme
ara4n Feb 19, 2017
7d07e7f
Merge pull request #711 from matrix-org/dbkr/fix_commonmark_quote_mul…
richvdh Feb 20, 2017
6fead66
MELS: check scroll on load + use mels-1,-2,... key
Feb 20, 2017
9eef3c5
Allow setting the default HS from the query parameter
Feb 20, 2017
6af0b96
first cut of improving UX for deleting devices.
ara4n Feb 21, 2017
aabf925
anchor the authcache on LoggedInView to prevent it persisting over lo…
ara4n Feb 21, 2017
629f8ca
oops, remove unneeded import
ara4n Feb 21, 2017
454dc8e
Merge pull request #717 from matrix-org/matthew/auth-cache
ara4n Feb 21, 2017
995e59b
Merge pull request #716 from matrix-org/luke/feature-default-hs
lukebarnard1 Feb 21, 2017
05d242c
allow @local:domain style mxids
ara4n Feb 21, 2017
581c8c1
Do not push a dummy element with a scroll token for invisible events
Feb 21, 2017
fd146a7
Clarify non-e2e vs. e2e /w composers placeholder
Feb 21, 2017
658c34a
Change the name of the database
kegsay Feb 21, 2017
7cbd5a7
Merge pull request #719 from matrix-org/kegan/db-name
kegsay Feb 21, 2017
878e31e
Show UDDialog on m.call.invite failure
Feb 21, 2017
e0724e7
add .editorconfig
aviraldg Feb 9, 2017
f600121
Merge pull request #713 from aviraldg/add-editorconfig
dbkr Feb 21, 2017
c13ff25
Add "Retry" button to UDE
Feb 22, 2017
f230b0a
Fix status bar expanded on tab-complete
Feb 22, 2017
e9318f5
Merge pull request #722 from matrix-org/luke/fix-status-bar-tab-complete
dbkr Feb 22, 2017
799e5ee
Less jargon
Feb 22, 2017
9515cf2
Only hangup on call errors, not errors on sendEvent
Feb 22, 2017
816e0be
Retry->Send anyway
Feb 22, 2017
2b91b0d
Merge pull request #720 from matrix-org/luke/clarify-e2e-input-box
dbkr Feb 22, 2017
436e6b3
Move UDE handling to a its own file, adjust wording
Feb 22, 2017
f92708f
In practice the MELS-1,2,3 solves nothing, revert it
Feb 22, 2017
b68b0e2
Merge Matthew's wording patch
Feb 22, 2017
b41787c
Initial work on improving invite dialog
Feb 23, 2017
8bd4269
Fix message composer placeholders
Feb 23, 2017
0a76e0f
Merge pull request #723 from matrix-org/luke/fix-e2e-input-placeholder
dbkr Feb 23, 2017
8737112
Merge pull request #715 from matrix-org/luke/mels-scrolling-fix
dbkr Feb 23, 2017
fd3c1ab
Merge pull request #718 from matrix-org/luke/ignore-no-tile-events
dbkr Feb 23, 2017
439bde3
General ChatInviteDialog optimisations
Feb 23, 2017
e1a40a8
Notify MatrixChat of teamToken after login
Feb 23, 2017
5146750
Port registration over to use InteractiveAuth
dbkr Feb 24, 2017
76b381b
Spurious newline
dbkr Feb 24, 2017
454aa07
Poll for authentication completion
dbkr Feb 24, 2017
5be2c62
Fix a couple of issues with RRs
Feb 27, 2017
886b0a3
Sanitise for *, fix style issues
Feb 27, 2017
5fc828f
Allow span, and only allow style attrib
Feb 27, 2017
b3b16d1
Merge pull request #727 from matrix-org/luke/fix-rrs
lukebarnard1 Feb 27, 2017
7221900
Refactor remove resend_all_events and cancel_all_events dispatches
Feb 27, 2017
e5853a6
Put back server picker for registration
dbkr Feb 27, 2017
c22db1d
Fix race when signup is completed elsewhere
dbkr Feb 27, 2017
4509901
image (gifs) and video messages will autoplay if enabled.
Half-Shot Feb 27, 2017
1995c16
Add a user option to enable autoplaying gifs and videos.
Half-Shot Feb 27, 2017
48a3d0d
Refactor to not set team token in bad ways
Feb 28, 2017
0ef8e2a
Various fixes
Feb 28, 2017
a339316
Use a "normal" promise in order to .then
Feb 28, 2017
f85c452
Merge pull request #726 from matrix-org/luke/rts-set-team-token-on-login
lukebarnard1 Feb 28, 2017
dd33624
Merge remote-tracking branch 'origin/develop' into dbkr/register_ui_auth
dbkr Mar 1, 2017
3942783
Use ES6 export style
Mar 1, 2017
6d296a0
Warn users about using e2e for the first time
Mar 1, 2017
187c91b
Adjust warning message
Mar 1, 2017
b7bd93c
var -> const
Mar 1, 2017
c9ef879
PR feedback: Move the email token request here
dbkr Mar 1, 2017
ef5d2bc
Get errorText from error in stageUpdated
dbkr Mar 1, 2017
9c5fb00
Fix syntax
dbkr Mar 1, 2017
36795fa
Use data-mx[-bg]-color instead of stripping style
Mar 2, 2017
b951713
Remove custom attribs as consumed
Mar 2, 2017
95cff17
Merge pull request #721 from matrix-org/luke/fix-refactor-UnknownDevi…
dbkr Mar 2, 2017
0035a91
Merge pull request #731 from matrix-org/luke/warn-users-e2e-first-time
dbkr Mar 2, 2017
4b5e8d6
Fixed styling + removed log line
Half-Shot Mar 2, 2017
8be66d0
Merge pull request #730 from Half-Shot/hs/video-gif-autoplay
dbkr Mar 2, 2017
e75c21e
Merge pull request #683 from matrix-org/luke/mels-xor
lukebarnard1 Mar 2, 2017
770c1ce
Remove redundant prop
dbkr Mar 2, 2017
518a749
Add proptypes / isRequired
dbkr Mar 2, 2017
a5cf3a9
doc
dbkr Mar 2, 2017
dd762cc
Add makeRegistrationUrl to proptypes
dbkr Mar 2, 2017
3028b33
Oops, re-add referrer param
dbkr Mar 2, 2017
0914226
Actuall pass our proxy makeRegistrationUrl
dbkr Mar 2, 2017
88586a0
Oops, lost defaultDeviceDisplayName
dbkr Mar 2, 2017
51b2001
Remove todo which is now done!
dbkr Mar 2, 2017
91ef26a
makeRegistrationUrl is required
dbkr Mar 2, 2017
9c6782a
Oops, lost trackPromise
dbkr Mar 2, 2017
0f8ab99
Have COLOR_REGEX constant
Mar 2, 2017
7a092e4
Submit a new display name on blur of input field
Mar 2, 2017
1d5e47c
On cancel, blur. Only onValueChanged when the value has changed...
Mar 2, 2017
f4278b6
Update comment
Mar 2, 2017
6a007d0
Merge pull request #610 from matrix-org/luke/feature-css-msg-colors
lukebarnard1 Mar 3, 2017
4fff383
Fix resend bar and "send anyway" in UDD
Mar 3, 2017
7be55ce
Merge pull request #733 from matrix-org/luke/display-name-blur-to-submit
lukebarnard1 Mar 3, 2017
b822bc6
Remove redundant null check
Mar 3, 2017
8522231
Revery unintentional change
dbkr Mar 3, 2017
923ea9c
Change timestamp permalinks to matrix.to
Mar 3, 2017
ab9aaa9
Merge pull request #732 from matrix-org/luke/fuse-test
lukebarnard1 Mar 3, 2017
977b8a7
Make UIAuth Dialog show an error
dbkr Mar 3, 2017
1bdf213
Merge pull request #729 from matrix-org/dbkr/register_ui_auth
dbkr Mar 3, 2017
ca5c2fb
Allow user to choose from existing DMs on new chat
Mar 3, 2017
62d9439
Remove old import & pass through result
dbkr Mar 3, 2017
2bd9885
Start to show redacted events
Mar 3, 2017
fa2cf41
Make COLOR_REGEX stricter
Mar 3, 2017
6c32e37
Remove seemingly unused "bounce"
Mar 3, 2017
5ef61b7
Only show a redaction tile for messages
Mar 3, 2017
9bae936
Add the redacter display name to the redaction text
Mar 3, 2017
9f6a5d1
Merge pull request #737 from matrix-org/luke/fix-color-regex-strictness
lukebarnard1 Mar 3, 2017
abd71cd
No need for "redactor" as we dont currently show it
Mar 3, 2017
edccfeb
No text required, do not continuate after redacted even
Mar 6, 2017
30eddf9
Merge pull request #734 from matrix-org/luke/fix-resend
dbkr Mar 6, 2017
49c66d8
Merge pull request #735 from matrix-org/luke/matrix-to-timestamp-perm…
dbkr Mar 6, 2017
c0fc3ba
Make redactions appear when the event has been redacted (on Room.reda…
Mar 6, 2017
a122b5d
Style
Mar 6, 2017
4548d1b
Use dispatch instead of passing `onClick`, adjust dialog wording.
Mar 6, 2017
20fa363
Remember to unregister on unmoun
Mar 6, 2017
04510da
Clarify "No devices" message
Mar 6, 2017
341f978
Fix the team server registration
dbkr Mar 6, 2017
bf348a0
Instead of listening for view_room, use a callback
Mar 6, 2017
391886c
Remove dis as a dep in RoomTile
Mar 6, 2017
87a5db6
Merge pull request #740 from matrix-org/luke/clarify-no-devices
dbkr Mar 6, 2017
65ce8c2
Merge pull request #741 from matrix-org/dbkr/fix_teamserver_2
dbkr Mar 6, 2017
b7f1b1a
Merge pull request #736 from matrix-org/luke/chat-create-or-reuse-dialog
lukebarnard1 Mar 7, 2017
2513bfa
Add onClick to permalinks to route within Riot
Mar 8, 2017
676c5c2
Merge pull request #739 from matrix-org/luke/visible-redactions
dbkr Mar 9, 2017
173dadd
Comment typo
Mar 9, 2017
c98a214
Merge branch 'develop' into luke/add-onclick-permalinks
lukebarnard1 Mar 9, 2017
0269562
Support registration & login with phone number (#742)
dbkr Mar 9, 2017
6c7b191
Merge pull request #605 from SijmenSchoon/feature/pastefiles
ara4n Mar 9, 2017
7fb9ce2
Merge pull request #744 from matrix-org/luke/add-onclick-permalinks
ara4n Mar 9, 2017
2786fb0
Revert "Support registration & login with phone number (#742)"
richvdh Mar 9, 2017
b7d5d2f
beautify UserSettings error msg
ara4n Mar 12, 2017
e5a5b5c
oops
ara4n Mar 12, 2017
71e0780
beautify search fail error
ara4n Mar 12, 2017
3aaf37d
beautify a tonne more errors
ara4n Mar 12, 2017
185473b
copyright...
ara4n Mar 12, 2017
3a849bc
name class to match file
ara4n Mar 12, 2017
bf64f38
name class to match file
ara4n Mar 12, 2017
8a0b08e
fix CSS for ChatCreateOrReuseDialog.js
ara4n Mar 13, 2017
925bbb7
fix kick dialog CSS
ara4n Mar 13, 2017
878413f
Support msisdn signin
dbkr Mar 14, 2017
2c1ac29
Send legacy parameters on login call
dbkr Mar 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 Aviral Dasgupta
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

[*]
charset=utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
plugins: [
"react",
"flowtype",
"babel"
],
env: {
es6: true,
Expand All @@ -23,6 +24,11 @@ module.exports = {
}
},
rules: {
// eslint's built in no-invalid-this rule breaks with class properties
"no-invalid-this": "off",
// so we replace it with a version that is class property aware
"babel/no-invalid-this": "error",

/** react **/
// This just uses the react plugin to help eslint known when
// variables have been used in JSX
Expand Down
2 changes: 1 addition & 1 deletion jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

export KARMAFLAGS="--no-colors"
export NVM_DIR="/home/jenkins/.nvm"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm use 4

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"isomorphic-fetch": "^2.2.1",
"linkifyjs": "^2.1.3",
"lodash": "^4.13.1",
"matrix-js-sdk": "0.7.5",
"matrix-js-sdk": "matrix-org/matrix-js-sdk#develop",
"optimist": "^0.6.1",
"q": "^1.4.1",
"react": "^15.4.0",
Expand Down Expand Up @@ -90,6 +90,7 @@
"babel-preset-react": "^6.11.1",
"eslint": "^3.13.1",
"eslint-config-google": "^0.7.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^6.9.0",
"expect": "^1.16.0",
Expand Down
12 changes: 11 additions & 1 deletion src/CallHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ function _setCallListeners(call) {
call.hangup();
_setCallState(undefined, call.roomId, "ended");
});
call.on('send_event_error', function(err) {
if (err.name === "UnknownDeviceError") {
dis.dispatch({
action: 'unknown_device_error',
err: err,
room: MatrixClientPeg.get().getRoom(call.roomId),
});
}
});
call.on("hangup", function() {
_setCallState(undefined, call.roomId, "ended");
});
Expand Down Expand Up @@ -301,9 +310,10 @@ function _onAction(payload) {
placeCall(call);
}, function(err) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Conference call failed: " + err);
Modal.createDialog(ErrorDialog, {
title: "Failed to set up conference call",
description: "Conference call failed: " + err,
description: "Conference call failed.",
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/ContentMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class ContentMessages {

sendContentToRoom(file, roomId, matrixClient) {
const content = {
body: file.name,
body: file.name || 'Attachment',
info: {
size: file.size,
}
Expand Down Expand Up @@ -316,7 +316,7 @@ class ContentMessages {
}

const upload = {
fileName: file.name,
fileName: file.name || 'Attachment',
roomId: roomId,
total: 0,
loaded: 0,
Expand Down
56 changes: 53 additions & 3 deletions src/HtmlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ emojione.imagePathSVG = 'emojione/svg/';
emojione.imageType = 'svg';

const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp+"+", "gi");
const COLOR_REGEX = /^#[0-9a-fA-F]{6}$/;

/* modified from https://github.com/Ranks/emojione/blob/master/lib/js/emojione.js
* because we want to include emoji shortnames in title text
Expand Down Expand Up @@ -57,6 +58,22 @@ export function unicodeToImage(str) {
return str;
}

/**
* Given one or more unicode characters (represented by unicode
* character number), return an image node with the corresponding
* emoji.
*
* @param alt {string} String to use for the image alt text
* @param unicode {integer} One or more integers representing unicode characters
* @returns A img node with the corresponding emoji
*/
export function charactersToImageNode(alt, ...unicode) {
const fileName = unicode.map((u) => {
return u.toString(16);
}).join('-');
return <img alt={alt} src={`${emojione.imagePathSVG}${fileName}.svg${emojione.cacheBustParam}`}/>;
}

export function stripParagraphs(html: string): string {
const contentDiv = document.createElement('div');
contentDiv.innerHTML = html;
Expand Down Expand Up @@ -87,11 +104,12 @@ var sanitizeHtmlParams = {
// deliberately no h1/h2 to stop people shouting.
'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
'nl', 'li', 'b', 'i', 'u', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre'
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'span',
],
allowedAttributes: {
// custom ones first:
font: ['color'], // custom to matrix
font: ['color', 'data-mx-bg-color', 'data-mx-color', 'style'], // custom to matrix
span: ['data-mx-bg-color', 'data-mx-color', 'style'], // custom to matrix
a: ['href', 'name', 'target', 'rel'], // remote target: custom to matrix
// We don't currently allow img itself by default, but this
// would make sense if we did
Expand Down Expand Up @@ -136,6 +154,38 @@ var sanitizeHtmlParams = {
attribs.rel = 'noopener'; // https://mathiasbynens.github.io/rel-noopener/
return { tagName: tagName, attribs : attribs };
},
'*': function(tagName, attribs) {
// Delete any style previously assigned, style is an allowedTag for font and span
// because attributes are stripped after transforming
delete attribs.style;

// Sanitise and transform data-mx-color and data-mx-bg-color to their CSS
// equivalents
const customCSSMapper = {
'data-mx-color': 'color',
'data-mx-bg-color': 'background-color',
// $customAttributeKey: $cssAttributeKey
};

let style = "";
Object.keys(customCSSMapper).forEach((customAttributeKey) => {
const cssAttributeKey = customCSSMapper[customAttributeKey];
const customAttributeValue = attribs[customAttributeKey];
if (customAttributeValue &&
typeof customAttributeValue === 'string' &&
COLOR_REGEX.test(customAttributeValue)
) {
style += cssAttributeKey + ":" + customAttributeValue + ";";
delete attribs[customAttributeKey];
}
});

if (style) {
attribs.style = style;
}

return { tagName: tagName, attribs: attribs };
},
},
};

Expand Down Expand Up @@ -290,7 +340,7 @@ export function bodyToHtml(content, highlights, opts) {
}

EMOJI_REGEX.lastIndex = 0;
let contentBodyTrimmed = content.body.trim();
let contentBodyTrimmed = content.body !== undefined ? content.body.trim() : '';
let match = EMOJI_REGEX.exec(contentBodyTrimmed);
let emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length;

Expand Down
3 changes: 1 addition & 2 deletions src/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import MultiInviter from './utils/MultiInviter';

const emailRegex = /^\S+@\S+\.\S+$/;

// We allow localhost for mxids to avoid confusion
const mxidRegex = /^@\S+:(?:\S+\.\S+|localhost)$/
const mxidRegex = /^@\S+:\S+$/

export function getAddressType(inputText) {
const isEmailAddress = emailRegex.test(inputText);
Expand Down
Loading