Merge branch 'master' of github.com:matrix-org/synapse into develop

This commit is contained in:
Erik Johnston 2014-09-18 14:52:19 +01:00
commit 79a5fb469b
5 changed files with 17 additions and 21 deletions

View File

@ -1,3 +1,12 @@
Changes in synapse 0.3.1 (2014-09-18)
=====================================
This is a release to hotfix v0.3.0 to fix two regressions.
Webclient:
* Fix a regression where we sometimes displayed duplicate events.
* Fix a regression where we didn't immediately remove rooms you were
banned in from the recents list.
Changes in synapse 0.3.0 (2014-09-18) Changes in synapse 0.3.0 (2014-09-18)
===================================== =====================================
See UPGRADE for information about changes to the client server API, including See UPGRADE for information about changes to the client server API, including

View File

@ -1 +1 @@
0.3.0 0.3.1

View File

@ -16,4 +16,4 @@
""" This is a reference implementation of a synapse home server. """ This is a reference implementation of a synapse home server.
""" """
__version__ = "0.3.0" __version__ = "0.3.1"

View File

@ -232,20 +232,12 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
}; };
var handleRoomMember = function(event, isLiveEvent, isStateEvent) { var handleRoomMember = function(event, isLiveEvent, isStateEvent) {
// if the server is stupidly re-relaying a no-op join, discard it.
if (event.prev_content &&
event.content.membership === "join" &&
event.content.membership === event.prev_content.membership)
{
return;
}
// add membership changes as if they were a room message if something interesting changed // add membership changes as if they were a room message if something interesting changed
// Exception: Do not do this if the event is a room state event because such events already come // Exception: Do not do this if the event is a room state event because such events already come
// as room messages events. Moreover, when they come as room messages events, they are relatively ordered // as room messages events. Moreover, when they come as room messages events, they are relatively ordered
// with other other room messages XXX This is no longer true, you only get a single event, not a room message event. // with other other room messages
// FIXME: This possibly reintroduces multiple join messages. if (event.content.prev !== event.content.membership && !isStateEvent) {
if (event.content.prev !== event.content.membership) { // && !isStateEvent
if (isLiveEvent) { if (isLiveEvent) {
$rootScope.events.rooms[event.room_id].messages.push(event); $rootScope.events.rooms[event.room_id].messages.push(event);
} }
@ -376,7 +368,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
handleMessage(event, isLiveEvent); handleMessage(event, isLiveEvent);
break; break;
case "m.room.member": case "m.room.member":
isStateEvent = true;
handleRoomMember(event, isLiveEvent, isStateEvent); handleRoomMember(event, isLiveEvent, isStateEvent);
break; break;
case "m.presence": case "m.presence":
@ -406,8 +397,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
// isLiveEvents determines whether notifications should be shown, whether // isLiveEvents determines whether notifications should be shown, whether
// messages get appended to the start/end of lists, etc. // messages get appended to the start/end of lists, etc.
handleEvents: function(events, isLiveEvents, isStateEvents) { handleEvents: function(events, isLiveEvents, isStateEvents) {
// XXX FIXME TODO: isStateEvents is being left as undefined sometimes. It makes no sense
// to have isStateEvents as an arg, since things like m.room.member are ALWAYS state events.
for (var i=0; i<events.length; i++) { for (var i=0; i<events.length; i++) {
this.handleEvent(events[i], isLiveEvents, isStateEvents); this.handleEvent(events[i], isLiveEvents, isStateEvents);
} }
@ -423,7 +412,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
if (dir && 'b' === dir) { if (dir && 'b' === dir) {
// paginateBackMessages requests messages to be in reverse chronological order // paginateBackMessages requests messages to be in reverse chronological order
for (var i=0; i<events.length; i++) { for (var i=0; i<events.length; i++) {
// FIXME: Being live != being state
this.handleEvent(events[i], isLiveEvents, isLiveEvents); this.handleEvent(events[i], isLiveEvents, isLiveEvents);
} }
@ -433,7 +421,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
else { else {
// InitialSync returns messages in chronological order // InitialSync returns messages in chronological order
for (var i=events.length - 1; i>=0; i--) { for (var i=events.length - 1; i>=0; i--) {
// FIXME: Being live != being state
this.handleEvent(events[i], isLiveEvents, isLiveEvents); this.handleEvent(events[i], isLiveEvents, isLiveEvents);
} }
// Store where to start pagination // Store where to start pagination

View File

@ -19,14 +19,13 @@
angular.module('RecentsController') angular.module('RecentsController')
.filter('orderRecents', ["matrixService", "eventHandlerService", function(matrixService, eventHandlerService) { .filter('orderRecents', ["matrixService", "eventHandlerService", function(matrixService, eventHandlerService) {
return function(rooms) { return function(rooms) {
var user_id = matrixService.config().user_id; var user_id = matrixService.config().user_id;
// Transform the dict into an array // Transform the dict into an array
// The key, room_id, is already in value objects // The key, room_id, is already in value objects
var filtered = []; var filtered = [];
angular.forEach(rooms, function(room, room_id) { angular.forEach(rooms, function(room, room_id) {
// Show the room only if the user has joined it or has been invited // Show the room only if the user has joined it or has been invited
// (ie, do not show it if he has been banned) // (ie, do not show it if he has been banned)
var member = eventHandlerService.getMember(room_id, user_id); var member = eventHandlerService.getMember(room_id, user_id);
@ -35,8 +34,9 @@ angular.module('RecentsController')
// Count users here // Count users here
// TODO: Compute it directly in eventHandlerService // TODO: Compute it directly in eventHandlerService
room.numUsersInRoom = eventHandlerService.getUsersCountInRoom(room_id); room.numUsersInRoom = eventHandlerService.getUsersCountInRoom(room_id);
filtered.push(room);
} }
filtered.push(room);
}); });
// And time sort them // And time sort them
@ -60,4 +60,4 @@ angular.module('RecentsController')
}); });
return filtered; return filtered;
}; };
}]); }]);