Compare commits

...

33 Commits

Author SHA1 Message Date
Kegan Dougal 19721c3f53 Bump to 0.2.2 and update CHANGELOG 2015-10-13 10:31:00 +01:00
Kegan Dougal cde948814a Linting (jsdoc) 2015-10-13 10:20:38 +01:00
Kegan Dougal 2bb65fe644 Add RoomState.getLastModifiedTime() and JSDoc 2015-10-13 10:18:01 +01:00
Kegan Dougal 1260dcee76 Add User.getLastModifiedTime() 2015-10-13 10:11:22 +01:00
Kegan Dougal 3baab40bdb Add RoomMember.getLastModifiedTime() 2015-10-13 10:09:38 +01:00
Kegan Dougal 0988332850 Minor cleanup 2015-10-13 10:05:29 +01:00
Kegan Dougal 385ebd3bfb Semicolons 2015-10-12 17:57:02 +01:00
Kegsay 7635473a16 Merge pull request #20 from stevenhammerton/sh-cas-auth
CAS Auth
2015-10-12 16:59:17 +01:00
Steven Hammerton d004d0b927 Were not authed when fetching CAS server URL, so use request rather than authed request 2015-10-09 11:18:05 +01:00
Steven Hammerton 33bede1dfe Rename methods for getting homeserver and identity server URLs 2015-10-09 11:16:57 +01:00
Steven Hammerton c22382360b Add client functions around new synapse CAS login 2015-10-08 22:55:38 +01:00
Steven Hammerton 79db25b131 Add functions for getting the HS and IS urls out of the client (required for CAS login in react-sdk) 2015-10-08 22:55:38 +01:00
David Baker 682880d0c9 Use a default content type if the browser doesn't give us one: home servers require a content type header. 2015-10-02 18:36:09 +01:00
Matthew Hodgson a16ded9f4d oops 2015-09-18 01:56:53 +02:00
Matthew Hodgson 2f75bb75dd fix NPE if our user does not yet appear to be in the queried room 2015-09-18 01:55:40 +02:00
David Baker ac7457f532 null check 2015-09-16 21:27:21 +01:00
Kegan Dougal f665748fe5 Add 0.2.1 browser-dist. 2015-09-11 10:59:44 +01:00
Kegan Dougal 92e3a28315 Add gendoc script 2015-09-11 10:24:38 +01:00
Kegan Dougal 4e26790418 Merge branch 'develop' 2015-09-11 10:17:20 +01:00
Kegan Dougal f1793ff96d Merge branch 'release-v0.2.1' into develop 2015-09-11 10:17:09 +01:00
Kegan Dougal 22a9db6c29 Add CHANGELOG and bump to 0.2.1 2015-09-11 10:12:54 +01:00
Kegsay 7a4a3a1239 Merge pull request #19 from matrix-org/matthew/http_exceptions
#19 - Gracefully fail when synchronous errors occur when calling the request function
2015-09-02 09:57:29 +01:00
Kegan Dougal 3c01e2db43 Style checks 2015-09-02 09:50:43 +01:00
Matthew Hodgson 3b9f1728c7 turn HTTP exceptions into errbacks or rejected deferreds rather than bubbling them up and expecting the app to have try blocks eeeeeeeeeverywhere 2015-08-31 18:26:27 +01:00
Kegan Dougal 6d6868df73 Mention the user_id of the inviter for invited room names 2015-08-14 17:09:21 +01:00
Kegan Dougal c1c2731f2e Set the Content-Type on uploads
Most browsers seem to set this if you forget, but some don't.
2015-08-14 15:09:31 +01:00
David Baker e859119bde Support allowDefault flag on room avatars too 2015-08-13 17:12:09 +01:00
David Baker 9fab329a70 Add option to prevent the SDK from returning default avatar URLs. 2015-08-13 17:07:34 +01:00
Kegan Dougal deaaee4986 Add 'opts' to joinRoom function.
Add 'syncRoom' option to allow developers to join rooms without doing a
room initial sync. This is a breaking change.
2015-08-04 12:57:30 +01:00
Kegan Dougal 54a5c38b66 Do not retry requests which 40[0/1/3]. Set 'errcode' on MatrixErrors 2015-07-29 10:30:07 +01:00
Kegan Dougal 7f9c88e53f Add create/getAlias and sendNotice/sendHtmlNotice methods. 2015-07-28 14:51:26 +01:00
Kegan Dougal 3864472057 Fix test race condition.
It was possible for the test to end (via done()) before the final /events req
was flushed, resulting in a fail as there were requests outstanding. We now wait
until the final flush is done before done()ing.
2015-07-28 13:40:02 +01:00
Kegan Dougal 759dece725 Minor JSDoc fix. 2015-07-28 13:27:57 +01:00
17 changed files with 10355 additions and 36 deletions
+1
View File
@@ -1,3 +1,4 @@
.jsdoc
node_modules
.lock-wscript
build/Release
+56
View File
@@ -1,3 +1,59 @@
Changes in 0.2.2
================
Bug fixes:
* Null pointer fixes for VoIP calling and push notification processing.
* Set the `Content-Type` to `application/octet-stream` in the event that the
file object has no `type`.
New methods:
* Added `MatrixClient.getCasServer()` which calls through to the HTTP endpoint
`/login/cas`.
* Added `MatrixClient.loginWithCas(ticket, service)` which logs in with the
type `m.login.cas`.
* Added `MatrixClient.getHomeserverUrl()` which returns the URL passed in the
constructor.
* Added `MatrixClient.getIdentityServerUrl()` which returns the URL passed in
the constructor.
* Added `getLastModifiedTime()` to `RoomMember`, `RoomState` and `User` objects.
This makes it easier to see if the object in question has changed, which can
be used to improve performance by only rendering when these objects change.
Changes in 0.2.1
================
Bug fixes:
* The `Content-Type` of file uploads is now explicitly set, without relying
on the browser to do it for us.
Improvements:
* The `MatrixScheduler.RETRY_BACKOFF_RATELIMIT` function will not retry when
the response is a 400,401,403.
* The text returned from a room invite now includes who the invite was from.
* There is now a try/catch block around the `request` function which will
reject/errback appropriately if an exception is thrown synchronously in it.
Breaking changes:
* `MatrixClient.joinRoom` has changed from `(roomIdOrAlias, callback)` to
`(roomIdOrAlias, opts, callback)`.
New methods:
* `MatrixClient.createAlias(alias, roomId)`
* `MatrixClient.getRoomIdForAlias(alias)`
* `MatrixClient.sendNotice(roomId, body, txnId, callback)`
* `MatrixClient.sendHtmlNotice(roomId, body, htmlBody, callback)`
Modified methods:
* `MatrixClient.joinRoom(roomIdOrAlias, opts)` where `opts` can include a
`syncRoom: true|false` flag to control whether a room initial sync is
performed after joining the room.
* `MatrixClient.getAvatarUrlForMember` has a new last arg `allowDefault` which
returns the default identicon URL if `true`.
* `MatrixClient.getAvatarUrlForRoom` has a new last arg `allowDefault` which
is passed through to the default identicon generation for
`getAvatarUrlForMember`.
Changes in 0.2.0
================
+6 -8
View File
@@ -105,7 +105,7 @@ you'll see used is:
The ``callback`` parameter is optional, so you could do:
```javascript
matrixClient.someMethod(arg1, arg2).then(function(result) {
matrixClient.someMethod(arg1, arg2).then(function(err, result) {
...
});
```
@@ -216,20 +216,18 @@ API Reference
=============
A hosted reference can be found at
http://matrix-org.github.io/matrix-js-sdk/global.html
http://matrix-org.github.io/matrix-js-sdk/index.html
This SDK uses JSDoc3 style comments. You can manually build and
host the API reference from the source files like this:
```
$ npm install -g jsdoc
$ jsdoc -r lib/
$ cd out
$ npm run gendoc
$ cd .jsdoc
$ python -m SimpleHTTPServer 8005
```
Then visit ``http://localhost:8005`` to see the API docs. By
default, ``jsdoc`` produces HTML in the ``out`` folder.
Then visit ``http://localhost:8005`` to see the API docs.
Contributing
============
@@ -259,7 +257,7 @@ To run tests (Jasmine)::
$ npm test
```
To run linters (Google Closure Linter and JSHint):
To run linting:
```
$ npm run lint
```
+10023
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+143 -7
View File
@@ -64,6 +64,9 @@ var OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2";
function MatrixClient(opts) {
utils.checkObjectHasKeys(opts, ["baseUrl", "request"]);
this.baseUrl = opts.baseUrl;
this.idBaseUrl = opts.idBaseUrl;
this.store = opts.store || new StubStore();
this.sessionStore = opts.sessionStore || null;
this.accountKey = "DEFAULT_KEY";
@@ -150,6 +153,21 @@ function MatrixClient(opts) {
}
utils.inherits(MatrixClient, EventEmitter);
/**
* Get the Homserver URL of this client
* @return {string} Homeserver URL of this client
*/
MatrixClient.prototype.getHomeserverUrl = function() {
return this.baseUrl;
};
/**
* Get the Identity Server URL of this client
* @return {string} Identity Server URL of this client
*/
MatrixClient.prototype.getIdentityServerUrl = function() {
return this.idBaseUrl;
};
/**
* Is end-to-end crypto enabled for this client.
@@ -502,11 +520,22 @@ MatrixClient.prototype.createRoom = function(options, callback) {
/**
* Join a room. If you have already joined the room, this will no-op.
* @param {string} roomIdOrAlias The room ID or room alias to join.
* @param {Object} opts Options when joining the room.
* @param {boolean} opts.syncRoom True to do a room initial sync on the resulting
* room. If false, the <strong>returned Room object will have no current state.
* </strong> Default: true.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Room object.
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.joinRoom = function(roomIdOrAlias, callback) {
MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) {
// to help people when upgrading..
if (utils.isFunction(opts)) {
throw new Error("Expected 'opts' object, got function.");
}
opts = opts || {
syncRoom: true
};
var room = this.getRoom(roomIdOrAlias);
if (room && room.hasMembershipState(this.credentials.userId, "join")) {
return q(room);
@@ -518,7 +547,10 @@ MatrixClient.prototype.joinRoom = function(roomIdOrAlias, callback) {
function(res) {
var roomId = res.room_id;
var room = createNewRoom(self, roomId);
return _syncRoom(self, room);
if (opts.syncRoom) {
return _syncRoom(self, room);
}
return q(room);
}, function(err) {
_reject(callback, defer, err);
}).done(function(room) {
@@ -1003,6 +1035,22 @@ MatrixClient.prototype.sendTextMessage = function(roomId, body, txnId, callback)
return this.sendMessage(roomId, content, txnId, callback);
};
/**
* @param {string} roomId
* @param {string} body
* @param {string} txnId Optional.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendNotice = function(roomId, body, txnId, callback) {
var content = {
msgtype: "m.notice",
body: body
};
return this.sendMessage(roomId, content, txnId, callback);
};
/**
* @param {string} roomId
* @param {string} body
@@ -1058,6 +1106,24 @@ MatrixClient.prototype.sendHtmlMessage = function(roomId, body, htmlBody, callba
return this.sendMessage(roomId, content, callback);
};
/**
* @param {string} roomId
* @param {string} body
* @param {string} htmlBody
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendHtmlNotice = function(roomId, body, htmlBody, callback) {
var content = {
msgtype: "m.notice",
format: "org.matrix.custom.html",
body: body,
formatted_body: htmlBody
};
return this.sendMessage(roomId, content, callback);
};
/**
* Upload a file to the media repository on the home server.
* @param {File} file object
@@ -1093,6 +1159,42 @@ MatrixClient.prototype.sendTyping = function(roomId, isTyping, timeoutMs, callba
);
};
/**
* Create an alias to room ID mapping.
* @param {string} alias The room alias to create.
* @param {string} roomId The room ID to link the alias to.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO.
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.createAlias = function(alias, roomId, callback) {
var path = utils.encodeUri("/directory/room/$alias", {
$alias: alias
});
var data = {
room_id: roomId
};
return this._http.authedRequest(
callback, "PUT", path, undefined, data
);
};
/**
* Get room info for the given alias.
* @param {string} alias The room alias to resolve.
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Object with room_id and servers.
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.getRoomIdForAlias = function(alias, callback) {
var path = utils.encodeUri("/directory/room/$alias", {
$alias: alias
});
return this._http.authedRequest(
callback, "GET", path
);
};
/**
* @param {string} roomId
* @param {string} eventId
@@ -1309,17 +1411,21 @@ MatrixClient.prototype.setAvatarUrl = function(url, callback) {
* @param {Number} height The desired height of the thumbnail.
* @param {string} resizeMethod The thumbnail resize method to use, either
* "crop" or "scale".
* @param {Boolean} allowDefault (optional) Passing false causes this method to
* return null if the user has no avatar image. Otherwise, a default image URL
* will be returned.
* @return {?string} the avatar URL or null.
*/
MatrixClient.prototype.getAvatarUrlForMember =
function(member, width, height, resizeMethod) {
function(member, width, height, resizeMethod, allowDefault) {
if (!member || !member.events.member) {
return null;
}
if (allowDefault === undefined) { allowDefault = true; }
var rawUrl = member.events.member.getContent().avatar_url;
if (rawUrl) {
return this._http.getHttpUriForMxc(rawUrl, width, height, resizeMethod);
} else {
} else if (allowDefault) {
return this._http.getIdenticonUri(member.userId, width, height);
}
return null;
@@ -1333,10 +1439,13 @@ MatrixClient.prototype.getAvatarUrlForMember =
* @param {Number} height The desired height of the thumbnail.
* @param {string} resizeMethod The thumbnail resize method to use, either
* "crop" or "scale".
* @param {Boolean} allowDefault (optional) Passing false causes this method to
* return null if the user has no avatar image. Otherwise, a default image URL
* will be returned.
* @return {?string} the avatar URL or null.
*/
MatrixClient.prototype.getAvatarUrlForRoom =
function(room, width, height, resizeMethod) {
function(room, width, height, resizeMethod, allowDefault) {
if (!room || !room.currentState || !room.currentState.members) {
return null;
@@ -1348,7 +1457,9 @@ MatrixClient.prototype.getAvatarUrlForRoom =
});
if (members[0]) {
return this.getAvatarUrlForMember(members[0], width, height, resizeMethod);
return this.getAvatarUrlForMember(
members[0], width, height, resizeMethod, allowDefault
);
}
return null;
};
@@ -1625,6 +1736,31 @@ MatrixClient.prototype.loginWithSAML2 = function(relayState, callback) {
}, callback);
};
/**
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.getCasServer = function(callback) {
return this._http.request(
callback, "GET", "/login/cas", undefined, undefined
);
};
/**
* @param {string} ticket (Received from CAS)
* @param {string} service Service to which the token was granted
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.loginWithCas = function(ticket, service, callback) {
return this.login("m.login.cas", {
ticket: ticket,
service: service
}, callback);
};
// Push operations
// ===============
@@ -2362,7 +2498,7 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
/**
* Fires whenever an incoming call arrives.
* @event module:client~MatrixClient#"Call.incoming"
* @param {MatrixCall} call The incoming call.
* @param {module:webrtc/call~MatrixCall} call The incoming call.
* @example
* matrixClient.on("Call.incoming", function(call){
* call.answer(); // auto-answer
+38 -14
View File
@@ -205,6 +205,13 @@ module.exports.MatrixHttpApi.prototype = {
url += "&filename=" + encodeURIComponent(file.name);
xhr.open("POST", url);
if (file.type) {
xhr.setRequestHeader("Content-Type", file.type);
} else {
// if the file doesn't have a mime type, use a default since
// the HS errors if we don't supply one.
xhr.setRequestHeader("Content-Type", 'application/octet-stream');
}
xhr.send(file);
} else {
var queryParams = {
@@ -375,23 +382,38 @@ module.exports.MatrixHttpApi.prototype = {
}
}
var defer = q.defer();
this.opts.request(
{
uri: uri,
method: method,
withCredentials: false,
qs: queryParams,
body: data,
json: true,
_matrix_opts: this.opts
},
requestCallback(defer, callback, this.opts.onlyData)
);
try {
this.opts.request(
{
uri: uri,
method: method,
withCredentials: false,
qs: queryParams,
body: data,
json: true,
_matrix_opts: this.opts
},
requestCallback(defer, callback, this.opts.onlyData)
);
}
catch (ex) {
defer.reject(ex);
if (callback) {
callback(ex);
}
}
return defer.promise;
}
};
/*
* Returns a callback that can be invoked by an HTTP request on completion,
* that will either resolve or reject the given defer as well as invoke the
* given userDefinedCallback (if any).
*
* If onlyData is true, the defer/callback is invoked with the body of the
* response, otherwise the result code.
*/
var requestCallback = function(defer, userDefinedCallback, onlyData) {
userDefinedCallback = userDefinedCallback || function() {};
@@ -422,12 +444,14 @@ var requestCallback = function(defer, userDefinedCallback, onlyData) {
* information specific to the standard Matrix error response.
* @constructor
* @param {Object} errorJson The Matrix error JSON returned from the homeserver.
* @prop {string} name The Matrix 'errcode' value, e.g. "M_FORBIDDEN".
* @prop {string} errcode The Matrix 'errcode' value, e.g. "M_FORBIDDEN".
* @prop {string} name Same as MatrixError.errcode but with a default unknown string.
* @prop {string} message The Matrix 'error' value, e.g. "Missing token."
* @prop {Object} data The raw Matrix error JSON used to construct this object.
* @prop {integer} httpStatus The numeric HTTP status code given
*/
module.exports.MatrixError = function MatrixError(errorJson) {
this.errcode = errorJson.errcode;
this.name = errorJson.errcode || "Unknown error code";
this.message = errorJson.error || "Unknown message";
this.data = errorJson;
+22
View File
@@ -35,6 +35,7 @@ function RoomMember(roomId, userId) {
this.events = {
member: null
};
this._updateModifiedTime();
}
utils.inherits(RoomMember, EventEmitter);
@@ -59,9 +60,11 @@ RoomMember.prototype.setMembershipEvent = function(event, roomState) {
var oldName = this.name;
this.name = calculateDisplayName(this, event, roomState);
if (oldMembership !== this.membership) {
this._updateModifiedTime();
this.emit("RoomMember.membership", event, this);
}
if (oldName !== this.name) {
this._updateModifiedTime();
this.emit("RoomMember.name", event, this);
}
};
@@ -96,6 +99,7 @@ RoomMember.prototype.setPowerLevelEvent = function(powerLevelEvent) {
// emit for changes in powerLevelNorm as well (since the app will need to
// redraw everyone's level if the max has changed)
if (oldPowerLevel !== this.powerLevel || oldPowerLevelNorm !== this.powerLevelNorm) {
this._updateModifiedTime();
this.emit("RoomMember.powerLevel", powerLevelEvent, this);
}
};
@@ -121,10 +125,28 @@ RoomMember.prototype.setTypingEvent = function(event) {
this.typing = true;
}
if (oldTyping !== this.typing) {
this._updateModifiedTime();
this.emit("RoomMember.typing", event, this);
}
};
/**
* Update the last modified time to the current time.
*/
RoomMember.prototype._updateModifiedTime = function() {
this._modified = Date.now();
};
/**
* Get the timestamp when this RoomMember was last updated. This timestamp is
* updated when properties on this RoomMember are updated.
* It is updated <i>before</i> firing events.
* @return {number} The timestamp
*/
RoomMember.prototype.getLastModifiedTime = function() {
return this._modified;
};
function calculateDisplayName(member, event, roomState) {
var displayName = event.getDirectionalContent().displayname;
var selfUserId = member.userId;
+18
View File
@@ -30,6 +30,7 @@ function RoomState(roomId) {
this._sentinels = {
// userId: RoomMember
};
this._updateModifiedTime();
}
utils.inherits(RoomState, EventEmitter);
@@ -96,6 +97,7 @@ RoomState.prototype.getStateEvents = function(eventType, stateKey) {
*/
RoomState.prototype.setStateEvents = function(stateEvents) {
var self = this;
this._updateModifiedTime();
// update the core event dict
utils.forEach(stateEvents, function(event) {
@@ -162,6 +164,22 @@ RoomState.prototype.setTypingEvent = function(event) {
});
};
/**
* Update the last modified time to the current time.
*/
RoomState.prototype._updateModifiedTime = function() {
this._modified = Date.now();
};
/**
* Get the timestamp when this room state was last updated. This timestamp is
* updated when this object has received new state events.
* @return {number} The timestamp
*/
RoomState.prototype.getLastModifiedTime = function() {
return this._modified;
};
/**
* The RoomState class.
*/
+7 -1
View File
@@ -278,7 +278,13 @@ function calculateRoomName(room, userId) {
if (memberList.length === 1) {
// we exist, but no one else... self-chat or invite.
if (memberList[0].membership === "invite") {
return "Room Invite";
if (memberList[0].events.member) {
// extract who invited us to the room
return "Invite from " + memberList[0].events.member.getSender();
}
else {
return "Room Invite";
}
}
else {
return userId;
+22
View File
@@ -29,6 +29,7 @@ function User(userId) {
presence: null,
profile: null
};
this._updateModifiedTime();
}
utils.inherits(User, EventEmitter);
@@ -64,11 +65,32 @@ User.prototype.setPresenceEvent = function(event) {
this.avatarUrl = event.getContent().avatar_url;
this.lastActiveAgo = event.getContent().last_active_ago;
if (eventsToFire.length > 0) {
this._updateModifiedTime();
}
for (var i = 0; i < eventsToFire.length; i++) {
this.emit(eventsToFire[i], event, this);
}
};
/**
* Update the last modified time to the current time.
*/
User.prototype._updateModifiedTime = function() {
this._modified = Date.now();
};
/**
* Get the timestamp when this User was last updated. This timestamp is
* updated when this User receives a new Presence event which has updated a
* property on this object. It is updated <i>before</i> firing events.
* @return {number} The timestamp
*/
User.prototype.getLastModifiedTime = function() {
return this._modified;
};
/**
* The User class.
*/
+2 -1
View File
@@ -140,7 +140,8 @@ function PushProcessor(client) {
}
var room = client.getRoom(ev.room_id);
if (!room || !room.currentState || !room.currentState.members) { return false; }
if (!room || !room.currentState || !room.currentState.members ||
!room.currentState.getMember(client.credentials.userId)) { return false; }
var displayName = room.currentState.getMember(client.credentials.userId).name;
+4
View File
@@ -129,6 +129,10 @@ MatrixScheduler.prototype.queueEvent = function(event) {
* @see module:scheduler~retryAlgorithm
*/
MatrixScheduler.RETRY_BACKOFF_RATELIMIT = function(event, attempts, err) {
if (err.httpStatus === 400 || err.httpStatus === 403 || err.httpStatus === 401) {
// client error; no amount of retrying with save you now.
return -1;
}
if (err.name === "M_LIMIT_EXCEEDED") {
var waitTime = err.data.retry_after_ms;
if (waitTime) {
+5 -1
View File
@@ -156,7 +156,11 @@ MatrixCall.prototype._initWithInvite = function(event) {
// firefox and OpenWebRTC's RTCPeerConnection doesn't add streams until it
// starts getting media on them so we need to figure out whether a video
// channel has been offered by ourselves.
if (this.msg.offer.sdp.indexOf('m=video') > -1) {
if (
this.msg.offer &&
this.msg.offer.sdp &&
this.msg.offer.sdp.indexOf('m=video') > -1
) {
this.type = 'video';
}
else {
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "matrix-js-sdk",
"version": "0.2.0",
"version": "0.2.2",
"description": "Matrix Client-Server SDK for Javascript",
"main": "index.js",
"scripts": {
"test": "istanbul cover --report cobertura --config .istanbul.yml -i \"lib/**/*.js\" jasmine-node -- spec --verbose --junitreport --forceexit --captureExceptions",
"check": "jasmine-node spec --verbose --junitreport --forceexit --captureExceptions",
"gendoc": "jsdoc -r lib -P package.json -R README.md -d .jsdoc",
"build": "jshint -c .jshint lib/ && browserify browser-index.js -o dist/browser-matrix-dev.js --ignore-missing",
"watch": "watchify browser-index.js -o dist/browser-matrix-dev.js -v",
"lint": "jshint -c .jshint lib spec && gjslint --unix_mode --disable 0131,0211,0200,0222 --max_line_length 90 -r spec/ -r lib/",
@@ -280,11 +280,12 @@ describe("MatrixClient room timelines", function() {
client.scrollback(room, 1).done(function() {
expect(room.oldState.paginationToken).toEqual(sbEndTok);
done();
});
httpBackend.flush("/messages", 1);
httpBackend.flush("/events", 1);
httpBackend.flush("/events", 1).done(function() {
done();
});
});
httpBackend.flush("/initialSync", 1);
});
-1
View File
@@ -208,7 +208,6 @@ describe('NotificationService', function() {
}
});
pushProcessor = new PushProcessor(matrixClient);
console.log("badger: " + JSON.stringify(pushProcessor));
});
// User IDs