Skip to content

Commit 5e76345

Browse files
committed
Merge branch 'develop' into bwindels/resynconlltoggle
2 parents ba39b64 + fcebe89 commit 5e76345

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"test": "npm run test:build && npm run test:run",
1111
"check": "npm run test:build && _mocha --recursive specbuild --colors",
1212
"gendoc": "babel --no-babelrc -d .jsdocbuild src && jsdoc -r .jsdocbuild -P package.json -R README.md -d .jsdoc",
13-
"start": "babel -s -w -d lib src",
13+
"start": "npm run start:init && npm run start:watch",
14+
"start:watch": "babel -s -w --skip-initial-build -d lib src",
15+
"start:init": "babel -s -d lib src",
1416
"clean": "rimraf lib dist",
1517
"build": "babel -s -d lib src && rimraf dist && mkdir dist && browserify -d browser-index.js | exorcist dist/browser-matrix.js.map > dist/browser-matrix.js && uglifyjs -c -m -o dist/browser-matrix.min.js --source-map dist/browser-matrix.min.js.map --in-source-map dist/browser-matrix.js.map dist/browser-matrix.js",
1618
"dist": "npm run build",

spec/unit/room.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,24 +863,24 @@ describe("Room", function() {
863863
expect(name.indexOf(userB)).toNotEqual(-1, name);
864864
});
865865

866-
it("should not show the room alias if one exists for private " +
866+
it("should show the room alias if one exists for private " +
867867
"(invite join_rules) rooms if a room name doesn't exist.", function() {
868868
const alias = "#room_alias:here";
869869
setJoinRule("invite");
870870
setAliases([alias, "#another:one"]);
871871
room.recalculate();
872872
const name = room.name;
873-
expect(name).toEqual("Empty room");
873+
expect(name).toEqual(alias);
874874
});
875875

876-
it("should not show the room alias if one exists for public " +
876+
it("should show the room alias if one exists for public " +
877877
"(public join_rules) rooms if a room name doesn't exist.", function() {
878878
const alias = "#room_alias:here";
879879
setJoinRule("public");
880880
setAliases([alias, "#another:one"]);
881881
room.recalculate();
882882
const name = room.name;
883-
expect(name).toEqual("Empty room");
883+
expect(name).toEqual(alias);
884884
});
885885

886886
it("should show the room name if one exists for private " +

src/client.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,17 @@ MatrixClient.prototype.getGroups = function() {
772772
return this.store.getGroups();
773773
};
774774

775+
/**
776+
* Get the config for the media repository.
777+
* @param {module:client.callback} callback Optional.
778+
* @return {module:client.Promise} Resolves with an object containing the config.
779+
*/
780+
MatrixClient.prototype.getMediaConfig = function(callback) {
781+
return this._http.requestWithPrefix(
782+
callback, "GET", "/config", undefined, undefined, httpApi.PREFIX_MEDIA_R0,
783+
);
784+
};
785+
775786
// Room ops
776787
// ========
777788

src/models/room-state.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ RoomState.prototype.getSentinelMember = function(userId) {
180180
sentinel = new RoomMember(this.roomId, userId);
181181
const member = this.members[userId];
182182
if (member) {
183-
sentinel.setMembershipEvent(member.events.member);
183+
sentinel.setMembershipEvent(member.events.member, this);
184184
}
185185
this._sentinels[userId] = sentinel;
186186
}
@@ -501,7 +501,7 @@ RoomState.prototype._setOutOfBandMember = function(stateEvent) {
501501
}
502502

503503
const member = this._getOrCreateMember(userId, stateEvent);
504-
member.setMembershipEvent(stateEvent);
504+
member.setMembershipEvent(stateEvent, this);
505505
// needed to know which members need to be stored seperately
506506
// as the are not part of the sync accumulator
507507
// this is cleared by setMembershipEvent so when it's updated through /sync

src/models/room.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,15 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
15251525
}
15261526
}
15271527

1528-
const alias = room.getCanonicalAlias();
1528+
let alias = room.getCanonicalAlias();
1529+
1530+
if (!alias) {
1531+
const aliases = room.getAliases();
1532+
1533+
if (aliases.length) {
1534+
alias = aliases[0];
1535+
}
1536+
}
15291537
if (alias) {
15301538
return alias;
15311539
}

0 commit comments

Comments
 (0)