Change call signalling messages to be their own types of room events rather than room messages with different msgtypes: room messages should be things that the client can display as a unit message to the user.

This commit is contained in:
David Baker 2014-08-29 13:23:01 +01:00
parent 171d8b032f
commit 5308e3026a
5 changed files with 27 additions and 18 deletions

View file

@ -172,9 +172,9 @@ angular.module('matrixService', [])
return doRequest("GET", path, undefined, {});
},
sendMessage: function(room_id, txn_id, content) {
sendEvent: function(room_id, eventType, txn_id, content) {
// The REST path spec
var path = "/rooms/$room_id/send/m.room.message/$txn_id";
var path = "/rooms/$room_id/send/"+eventType+"/$txn_id";
if (!txn_id) {
txn_id = "m" + new Date().getTime();
@ -190,6 +190,10 @@ angular.module('matrixService', [])
return doRequest("PUT", path, undefined, content);
},
sendMessage: function(room_id, txn_id, content) {
return self.sendObject(room_id, 'm.room.message', txn_id, content);
},
// Send a text message
sendTextMessage: function(room_id, body, msg_id) {
var content = {