Skip to content

Commit 74afa71

Browse files
committed
Merge branch 'develop'
2 parents 044c752 + e48e636 commit 74afa71

75 files changed

Lines changed: 1899 additions & 278 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,34 @@ into the `vector` directory and run your own server.
2222

2323
Development
2424
===========
25-
You can work on any of the source files within Vector with the setup above,
26-
and your changes will cause an instant rebuild. If you also need to make
27-
changes to the react sdk, you can:
2825

29-
1. Link the react sdk package into the example:
26+
For simple tweaks, you can work on any of the source files within Vector with the
27+
setup above, and your changes will cause an instant rebuild.
28+
29+
However, all serious development on Vector happens on the `develop` branch. This typically
30+
depends on the `develop` snapshot versions of `matrix-react-sdk` and `matrix-js-sdk`
31+
too, which isn't expressed in Vector's `package.json`. To do this, check out
32+
the `develop` branches of these libraries and then use `npm link` to tell Vector
33+
about them:
34+
35+
1. `git clone git@github.com:matrix-org/matrix-react-sdk.git`
36+
2. `cd matrix-react-sdk`
37+
3. `git checkout develop`
38+
4. `npm install`
39+
5. `npm start` (to start the dev rebuilder)
40+
6. `cd ../vector-web`
41+
7. Link the react sdk package into the example:
3042
`npm link path/to/your/react/sdk`
31-
2. Start the development rebuilder in your react SDK directory:
32-
`npm start`
43+
44+
Similarly, you may need to `npm link path/to/your/js/sdk` in your `matrix-react-sdk`
45+
directory.
3346

3447
If you add or remove any components from the Vector skin, you will need to rebuild
3548
the skin's index by running, `npm run reskindex`.
3649

50+
You may need to run `npm i source-map-loader` in matrix-js-sdk if you get errors
51+
about "Cannot resolve module 'source-map-loader'" due to shortcomings in webpack.
52+
3753
Deployment
3854
==========
3955

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"filesize": "^3.1.2",
2828
"flux": "~2.0.3",
2929
"linkifyjs": "^2.0.0-beta.4",
30-
"matrix-js-sdk": "^0.2.1",
31-
"matrix-react-sdk": "^0.0.1",
30+
"matrix-js-sdk": "^0.3.0",
31+
"matrix-react-sdk": "^0.0.2",
3232
"q": "^1.4.1",
3333
"react": "^0.13.3",
3434
"react-loader": "^1.4.0"

‎src/Avatar.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
2020

2121
module.exports = {
2222
avatarUrlForMember: function(member, width, height, resizeMethod) {
23-
var url = MatrixClientPeg.get().getAvatarUrlForMember(
24-
member,
23+
var url = member.getAvatarUrl(
24+
MatrixClientPeg.get().getHomeserverUrl(),
2525
width,
2626
height,
2727
resizeMethod
2828
);
2929
if (!url) {
30-
url = this.defaultAvatarUrlForString(member.userId);
30+
// member can be null here currently since on invites, the JS SDK
31+
// does not have enough info to build a RoomMember object for
32+
// the inviter.
33+
url = this.defaultAvatarUrlForString(member ? member.userId : '');
3134
}
3235
return url;
3336
},

‎src/ContextualMenu.js‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,25 @@ module.exports = {
4949

5050
var position = {
5151
top: props.top - 20,
52-
right: props.right + 8,
5352
};
5453

54+
var chevron = null;
55+
if (props.left) {
56+
chevron = <img className="mx_ContextualMenu_chevron_left" src="img/chevron-left.png" width="9" height="16" />
57+
position.left = props.left + 8;
58+
} else {
59+
chevron = <img className="mx_ContextualMenu_chevron_right" src="img/chevron-right.png" width="9" height="16" />
60+
position.right = props.right + 8;
61+
}
62+
63+
var className = 'mx_ContextualMenu_wrapper';
64+
5565
// FIXME: If a menu uses getDefaultProps it clobbers the onFinished
5666
// property set here so you can't close the menu from a button click!
5767
var menu = (
58-
<div className="mx_ContextualMenu_wrapper">
68+
<div className={className}>
5969
<div className="mx_ContextualMenu" style={position}>
60-
<img className="mx_ContextualMenu_chevron" src="img/chevron-right.png" width="9" height="16" />
70+
{chevron}
6171
<Element {...props} onFinished={closeMenu}/>
6272
</div>
6373
<div className="mx_ContextualMenu_background" onClick={closeMenu}></div>

‎src/controllers/molecules/voip/CallView.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ module.exports = {
7474
);
7575
if (call) {
7676
call.setLocalVideoElement(this.getVideoView().getLocalVideoElement());
77-
// N.B. the remote video element is used for playback for audio for voice calls
7877
call.setRemoteVideoElement(this.getVideoView().getRemoteVideoElement());
78+
// give a separate element for audio stream playback - both for voice calls
79+
// and for the voice stream of screen captures
80+
call.setRemoteAudioElement(this.getVideoView().getRemoteAudioElement());
7981
}
8082
if (call && call.type === "video" && call.state !== 'ended') {
8183
// if this call is a conf call, don't display local video as the
@@ -88,6 +90,7 @@ module.exports = {
8890
else {
8991
this.getVideoView().getLocalVideoElement().style.display = "none";
9092
this.getVideoView().getRemoteVideoElement().style.display = "none";
93+
dis.dispatch({action: 'video_fullscreen', fullscreen: false});
9194
}
9295
}
9396
};

‎src/controllers/organisms/RoomList.js‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module.exports = {
3333
cli.on("Room", this.onRoom);
3434
cli.on("Room.timeline", this.onRoomTimeline);
3535
cli.on("Room.name", this.onRoomName);
36+
cli.on("RoomState.events", this.onRoomStateEvents);
37+
cli.on("RoomMember.name", this.onRoomMemberName);
3638

3739
var rooms = this.getRoomList();
3840
this.setState({
@@ -52,6 +54,11 @@ module.exports = {
5254
case 'call_state':
5355
this._recheckCallElement(this.props.selectedRoom);
5456
break;
57+
case 'view_tooltip':
58+
this.tooltip = payload.tooltip;
59+
this._repositionTooltip();
60+
if (this.tooltip) this.tooltip.style.display = 'block';
61+
break
5562
}
5663
},
5764

@@ -61,6 +68,7 @@ module.exports = {
6168
MatrixClientPeg.get().removeListener("Room", this.onRoom);
6269
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
6370
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
71+
MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents);
6472
}
6573
},
6674

@@ -105,6 +113,15 @@ module.exports = {
105113
this.refreshRoomList();
106114
},
107115

116+
onRoomStateEvents: function(ev, state) {
117+
setTimeout(this.refreshRoomList, 0);
118+
},
119+
120+
onRoomMemberName: function(ev, member) {
121+
setTimeout(this.refreshRoomList, 0);
122+
},
123+
124+
108125
refreshRoomList: function() {
109126
var rooms = this.getRoomList();
110127
this.setState({
@@ -150,6 +167,13 @@ module.exports = {
150167
});
151168
},
152169

170+
_repositionTooltip: function(e) {
171+
if (this.tooltip && this.tooltip.parentElement) {
172+
var scroll = this.getDOMNode();
173+
this.tooltip.style.top = (scroll.parentElement.offsetTop + this.tooltip.parentElement.offsetTop - scroll.scrollTop) + "px";
174+
}
175+
},
176+
153177
makeRoomTiles: function() {
154178
var self = this;
155179
var RoomTile = sdk.getComponent("molecules.RoomTile");
@@ -159,6 +183,7 @@ module.exports = {
159183
<RoomTile
160184
room={room}
161185
key={room.roomId}
186+
collapsed={self.props.collapsed}
162187
selected={selected}
163188
unread={self.state.activityMap[room.roomId] === 1}
164189
highlight={self.state.activityMap[room.roomId] === 2}

0 commit comments

Comments
 (0)