Merge pull request #3761 from matrix-org/travis/babel7-wp-es6-export

Convert CommonJS exports to ES6 exports
This commit is contained in:
Travis Ralston 2020-01-08 09:09:11 -07:00 committed by GitHub
commit 59f608ffd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
159 changed files with 745 additions and 717 deletions

View file

@ -306,4 +306,4 @@ class Analytics {
if (!global.mxAnalytics) { if (!global.mxAnalytics) {
global.mxAnalytics = new Analytics(); global.mxAnalytics = new Analytics();
} }
module.exports = global.mxAnalytics; export default global.mxAnalytics;

View file

@ -19,116 +19,114 @@ import {ContentRepo} from 'matrix-js-sdk';
import {MatrixClientPeg} from './MatrixClientPeg'; import {MatrixClientPeg} from './MatrixClientPeg';
import DMRoomMap from './utils/DMRoomMap'; import DMRoomMap from './utils/DMRoomMap';
module.exports = { export function avatarUrlForMember(member, width, height, resizeMethod) {
avatarUrlForMember: function(member, width, height, resizeMethod) { let url = member.getAvatarUrl(
let url = member.getAvatarUrl( MatrixClientPeg.get().getHomeserverUrl(),
MatrixClientPeg.get().getHomeserverUrl(), Math.floor(width * window.devicePixelRatio),
Math.floor(width * window.devicePixelRatio), Math.floor(height * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio), resizeMethod,
resizeMethod, false,
false, false,
false, );
); if (!url) {
if (!url) { // member can be null here currently since on invites, the JS SDK
// member can be null here currently since on invites, the JS SDK // does not have enough info to build a RoomMember object for
// does not have enough info to build a RoomMember object for // the inviter.
// the inviter. url = defaultAvatarUrlForString(member ? member.userId : '');
url = this.defaultAvatarUrlForString(member ? member.userId : ''); }
return url;
}
export function avatarUrlForUser(user, width, height, resizeMethod) {
const url = ContentRepo.getHttpUriForMxc(
MatrixClientPeg.get().getHomeserverUrl(), user.avatarUrl,
Math.floor(width * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio),
resizeMethod,
);
if (!url || url.length === 0) {
return null;
}
return url;
}
export function defaultAvatarUrlForString(s) {
const images = ['03b381', '368bd6', 'ac3ba8'];
let total = 0;
for (let i = 0; i < s.length; ++i) {
total += s.charCodeAt(i);
}
return require('../res/img/' + images[total % images.length] + '.png');
}
/**
* returns the first (non-sigil) character of 'name',
* converted to uppercase
* @param {string} name
* @return {string} the first letter
*/
export function getInitialLetter(name) {
if (!name) {
// XXX: We should find out what causes the name to sometimes be falsy.
console.trace("`name` argument to `getInitialLetter` not supplied");
return undefined;
}
if (name.length < 1) {
return undefined;
}
let idx = 0;
const initial = name[0];
if ((initial === '@' || initial === '#' || initial === '+') && name[1]) {
idx++;
}
// string.codePointAt(0) would do this, but that isn't supported by
// some browsers (notably PhantomJS).
let chars = 1;
const first = name.charCodeAt(idx);
// check if its the start of a surrogate pair
if (first >= 0xD800 && first <= 0xDBFF && name[idx+1]) {
const second = name.charCodeAt(idx+1);
if (second >= 0xDC00 && second <= 0xDFFF) {
chars++;
} }
return url; }
},
avatarUrlForUser: function(user, width, height, resizeMethod) { const firstChar = name.substring(idx, idx+chars);
const url = ContentRepo.getHttpUriForMxc( return firstChar.toUpperCase();
MatrixClientPeg.get().getHomeserverUrl(), user.avatarUrl, }
Math.floor(width * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio),
resizeMethod,
);
if (!url || url.length === 0) {
return null;
}
return url;
},
defaultAvatarUrlForString: function(s) { export function avatarUrlForRoom(room, width, height, resizeMethod) {
const images = ['03b381', '368bd6', 'ac3ba8']; const explicitRoomAvatar = room.getAvatarUrl(
let total = 0; MatrixClientPeg.get().getHomeserverUrl(),
for (let i = 0; i < s.length; ++i) { width,
total += s.charCodeAt(i); height,
} resizeMethod,
return require('../res/img/' + images[total % images.length] + '.png'); false,
}, );
if (explicitRoomAvatar) {
return explicitRoomAvatar;
}
/** let otherMember = null;
* returns the first (non-sigil) character of 'name', const otherUserId = DMRoomMap.shared().getUserIdForRoomId(room.roomId);
* converted to uppercase if (otherUserId) {
* @param {string} name otherMember = room.getMember(otherUserId);
* @return {string} the first letter } else {
*/ // if the room is not marked as a 1:1, but only has max 2 members
getInitialLetter(name) { // then still try to show any avatar (pref. other member)
if (!name) { otherMember = room.getAvatarFallbackMember();
// XXX: We should find out what causes the name to sometimes be falsy. }
console.trace("`name` argument to `getInitialLetter` not supplied"); if (otherMember) {
return undefined; return otherMember.getAvatarUrl(
}
if (name.length < 1) {
return undefined;
}
let idx = 0;
const initial = name[0];
if ((initial === '@' || initial === '#' || initial === '+') && name[1]) {
idx++;
}
// string.codePointAt(0) would do this, but that isn't supported by
// some browsers (notably PhantomJS).
let chars = 1;
const first = name.charCodeAt(idx);
// check if its the start of a surrogate pair
if (first >= 0xD800 && first <= 0xDBFF && name[idx+1]) {
const second = name.charCodeAt(idx+1);
if (second >= 0xDC00 && second <= 0xDFFF) {
chars++;
}
}
const firstChar = name.substring(idx, idx+chars);
return firstChar.toUpperCase();
},
avatarUrlForRoom(room, width, height, resizeMethod) {
const explicitRoomAvatar = room.getAvatarUrl(
MatrixClientPeg.get().getHomeserverUrl(), MatrixClientPeg.get().getHomeserverUrl(),
width, width,
height, height,
resizeMethod, resizeMethod,
false, false,
); );
if (explicitRoomAvatar) { }
return explicitRoomAvatar; return null;
} }
let otherMember = null;
const otherUserId = DMRoomMap.shared().getUserIdForRoomId(room.roomId);
if (otherUserId) {
otherMember = room.getMember(otherUserId);
} else {
// if the room is not marked as a 1:1, but only has max 2 members
// then still try to show any avatar (pref. other member)
otherMember = room.getAvatarFallbackMember();
}
if (otherMember) {
return otherMember.getAvatarUrl(
MatrixClientPeg.get().getHomeserverUrl(),
width,
height,
resizeMethod,
false,
);
}
return null;
},
};

View file

@ -302,7 +302,7 @@ function _onAction(payload) {
switch (payload.action) { switch (payload.action) {
case 'place_call': case 'place_call':
{ {
if (module.exports.getAnyActiveCall()) { if (callHandler.getAnyActiveCall()) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createTrackedDialog('Call Handler', 'Existing Call', ErrorDialog, { Modal.createTrackedDialog('Call Handler', 'Existing Call', ErrorDialog, {
title: _t('Existing Call'), title: _t('Existing Call'),
@ -355,7 +355,7 @@ function _onAction(payload) {
break; break;
case 'incoming_call': case 'incoming_call':
{ {
if (module.exports.getAnyActiveCall()) { if (callHandler.getAnyActiveCall()) {
// ignore multiple incoming calls. in future, we may want a line-1/line-2 setup. // ignore multiple incoming calls. in future, we may want a line-1/line-2 setup.
// we avoid rejecting with "busy" in case the user wants to answer it on a different device. // we avoid rejecting with "busy" in case the user wants to answer it on a different device.
// in future we could signal a "local busy" as a warning to the caller. // in future we could signal a "local busy" as a warning to the caller.
@ -523,7 +523,7 @@ if (!global.mxCallHandler) {
const callHandler = { const callHandler = {
getCallForRoom: function(roomId) { getCallForRoom: function(roomId) {
let call = module.exports.getCall(roomId); let call = callHandler.getCall(roomId);
if (call) return call; if (call) return call;
if (ConferenceHandler) { if (ConferenceHandler) {
@ -583,4 +583,4 @@ if (global.mxCallHandler === undefined) {
global.mxCallHandler = callHandler; global.mxCallHandler = callHandler;
} }
module.exports = global.mxCallHandler; export default global.mxCallHandler;

View file

@ -105,36 +105,33 @@ class UserEntity extends Entity {
} }
} }
export function newEntity(jsx, matchFn) {
const entity = new Entity();
entity.getJsx = function() {
return jsx;
};
entity.matches = matchFn;
return entity;
}
module.exports = { /**
newEntity: function(jsx, matchFn) { * @param {RoomMember[]} members
const entity = new Entity(); * @return {Entity[]}
entity.getJsx = function() { */
return jsx; export function fromRoomMembers(members) {
}; return members.map(function(m) {
entity.matches = matchFn; return new MemberEntity(m);
return entity; });
}, }
/** /**
* @param {RoomMember[]} members * @param {User[]} users
* @return {Entity[]} * @param {boolean} showInviteButton
*/ * @param {Function} inviteFn Called with the user ID.
fromRoomMembers: function(members) { * @return {Entity[]}
return members.map(function(m) { */
return new MemberEntity(m); export function fromUsers(users, showInviteButton, inviteFn) {
}); return users.map(function(u) {
}, return new UserEntity(u, showInviteButton, inviteFn);
});
/** }
* @param {User[]} users
* @param {boolean} showInviteButton
* @param {Function} inviteFn Called with the user ID.
* @return {Entity[]}
*/
fromUsers: function(users, showInviteButton, inviteFn) {
return users.map(function(u) {
return new UserEntity(u, showInviteButton, inviteFn);
});
},
};

View file

@ -16,41 +16,38 @@ limitations under the License.
'use strict'; 'use strict';
module.exports = { /**
* Returns the actual height that an image of dimensions (fullWidth, fullHeight)
/** * will occupy if resized to fit inside a thumbnail bounding box of size
* Returns the actual height that an image of dimensions (fullWidth, fullHeight) * (thumbWidth, thumbHeight).
* will occupy if resized to fit inside a thumbnail bounding box of size *
* (thumbWidth, thumbHeight). * If the aspect ratio of the source image is taller than the aspect ratio of
* * the thumbnail bounding box, then we return the thumbHeight parameter unchanged.
* If the aspect ratio of the source image is taller than the aspect ratio of * Otherwise we return the thumbHeight parameter scaled down appropriately to
* the thumbnail bounding box, then we return the thumbHeight parameter unchanged. * reflect the actual height the scaled thumbnail occupies.
* Otherwise we return the thumbHeight parameter scaled down appropriately to *
* reflect the actual height the scaled thumbnail occupies. * This is very useful for calculating how much height a thumbnail will actually
* * consume in the timeline, when performing scroll offset calcuations
* This is very useful for calculating how much height a thumbnail will actually * (e.g. scroll locking)
* consume in the timeline, when performing scroll offset calcuations */
* (e.g. scroll locking) export function thumbHeight(fullWidth, fullHeight, thumbWidth, thumbHeight) {
*/ if (!fullWidth || !fullHeight) {
thumbHeight: function(fullWidth, fullHeight, thumbWidth, thumbHeight) { // Cannot calculate thumbnail height for image: missing w/h in metadata. We can't even
if (!fullWidth || !fullHeight) { // log this because it's spammy
// Cannot calculate thumbnail height for image: missing w/h in metadata. We can't even return undefined;
// log this because it's spammy }
return undefined; if (fullWidth < thumbWidth && fullHeight < thumbHeight) {
} // no scaling needs to be applied
if (fullWidth < thumbWidth && fullHeight < thumbHeight) { return fullHeight;
// no scaling needs to be applied }
return fullHeight; const widthMulti = thumbWidth / fullWidth;
} const heightMulti = thumbHeight / fullHeight;
const widthMulti = thumbWidth / fullWidth; if (widthMulti < heightMulti) {
const heightMulti = thumbHeight / fullHeight; // width is the dominant dimension so scaling will be fixed on that
if (widthMulti < heightMulti) { return Math.floor(widthMulti * fullHeight);
// width is the dominant dimension so scaling will be fixed on that } else {
return Math.floor(widthMulti * fullHeight); // height is the dominant dimension so scaling will be fixed on that
} else { return Math.floor(heightMulti * fullHeight);
// height is the dominant dimension so scaling will be fixed on that }
return Math.floor(heightMulti * fullHeight); }
}
},
};

View file

@ -364,4 +364,4 @@ if (!global.mxNotifier) {
global.mxNotifier = Notifier; global.mxNotifier = Notifier;
} }
module.exports = global.mxNotifier; export default global.mxNotifier;

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -22,7 +23,7 @@ limitations under the License.
* @return {Object[]} An array of objects with the form: * @return {Object[]} An array of objects with the form:
* { key: $KEY, val: $VALUE, place: "add|del" } * { key: $KEY, val: $VALUE, place: "add|del" }
*/ */
module.exports.getKeyValueArrayDiffs = function(before, after) { export function getKeyValueArrayDiffs(before, after) {
const results = []; const results = [];
const delta = {}; const delta = {};
Object.keys(before).forEach(function(beforeKey) { Object.keys(before).forEach(function(beforeKey) {
@ -76,7 +77,7 @@ module.exports.getKeyValueArrayDiffs = function(before, after) {
}); });
return results; return results;
}; }
/** /**
* Shallow-compare two objects for equality: each key and value must be identical * Shallow-compare two objects for equality: each key and value must be identical
@ -84,7 +85,7 @@ module.exports.getKeyValueArrayDiffs = function(before, after) {
* @param {Object} objB Second object to compare against the first * @param {Object} objB Second object to compare against the first
* @return {boolean} whether the two objects have same key=values * @return {boolean} whether the two objects have same key=values
*/ */
module.exports.shallowEqual = function(objA, objB) { export function shallowEqual(objA, objB) {
if (objA === objB) { if (objA === objB) {
return true; return true;
} }
@ -109,4 +110,4 @@ module.exports.shallowEqual = function(objA, objB) {
} }
return true; return true;
}; }

View file

@ -25,7 +25,7 @@ import { _t } from './languageHandler';
* the client owns the given email address, which is then passed to the password * the client owns the given email address, which is then passed to the password
* API on the homeserver in question with the new password. * API on the homeserver in question with the new password.
*/ */
class PasswordReset { export default class PasswordReset {
/** /**
* Configure the endpoints for password resetting. * Configure the endpoints for password resetting.
* @param {string} homeserverUrl The URL to the HS which has the account to reset. * @param {string} homeserverUrl The URL to the HS which has the account to reset.
@ -101,4 +101,3 @@ class PasswordReset {
} }
} }
module.exports = PasswordReset;

View file

@ -47,4 +47,4 @@ class PlatformPeg {
if (!global.mxPlatformPeg) { if (!global.mxPlatformPeg) {
global.mxPlatformPeg = new PlatformPeg(); global.mxPlatformPeg = new PlatformPeg();
} }
module.exports = global.mxPlatformPeg; export default global.mxPlatformPeg;

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2018 New Vector Ltd Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -104,4 +105,4 @@ class Presence {
} }
} }
module.exports = new Presence(); export default new Presence();

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -18,40 +19,43 @@ import {MatrixClientPeg} from './MatrixClientPeg';
import dis from './dispatcher'; import dis from './dispatcher';
import { EventStatus } from 'matrix-js-sdk'; import { EventStatus } from 'matrix-js-sdk';
module.exports = { export default class Resend {
resendUnsentEvents: function(room) { static resendUnsentEvents(room) {
room.getPendingEvents().filter(function(ev) { room.getPendingEvents().filter(function (ev) {
return ev.status === EventStatus.NOT_SENT; return ev.status === EventStatus.NOT_SENT;
}).forEach(function(event) { }).forEach(function (event) {
module.exports.resend(event); Resend.resend(event);
}); });
}, }
cancelUnsentEvents: function(room) {
room.getPendingEvents().filter(function(ev) { static cancelUnsentEvents(room) {
room.getPendingEvents().filter(function (ev) {
return ev.status === EventStatus.NOT_SENT; return ev.status === EventStatus.NOT_SENT;
}).forEach(function(event) { }).forEach(function (event) {
module.exports.removeFromQueue(event); Resend.removeFromQueue(event);
}); });
}, }
resend: function(event) {
static resend(event) {
const room = MatrixClientPeg.get().getRoom(event.getRoomId()); const room = MatrixClientPeg.get().getRoom(event.getRoomId());
MatrixClientPeg.get().resendEvent(event, room).then(function(res) { MatrixClientPeg.get().resendEvent(event, room).then(function (res) {
dis.dispatch({ dis.dispatch({
action: 'message_sent', action: 'message_sent',
event: event, event: event,
}); });
}, function(err) { }, function (err) {
// XXX: temporary logging to try to diagnose // XXX: temporary logging to try to diagnose
// https://github.com/vector-im/riot-web/issues/3148 // https://github.com/vector-im/riot-web/issues/3148
console.log('Resend got send failure: ' + err.name + '('+err+')'); console.log('Resend got send failure: ' + err.name + '(' + err + ')');
dis.dispatch({ dis.dispatch({
action: 'message_send_failed', action: 'message_send_failed',
event: event, event: event,
}); });
}); });
}, }
removeFromQueue: function(event) {
static removeFromQueue(event) {
MatrixClientPeg.get().cancelPendingEvent(event); MatrixClientPeg.get().cancelPendingEvent(event);
}, }
}; }

View file

@ -24,12 +24,8 @@ function tsOfNewestEvent(room) {
} }
} }
function mostRecentActivityFirst(roomList) { export function mostRecentActivityFirst(roomList) {
return roomList.sort(function(a, b) { return roomList.sort(function(a, b) {
return tsOfNewestEvent(b) - tsOfNewestEvent(a); return tsOfNewestEvent(b) - tsOfNewestEvent(a);
}); });
} }
module.exports = {
mostRecentActivityFirst,
};

View file

@ -658,30 +658,29 @@ const onMessage = function(event) {
let listenerCount = 0; let listenerCount = 0;
let openManagerUrl = null; let openManagerUrl = null;
module.exports = {
startListening: function() {
if (listenerCount === 0) {
window.addEventListener("message", onMessage, false);
}
listenerCount += 1;
},
stopListening: function() { export function startListening() {
listenerCount -= 1; if (listenerCount === 0) {
if (listenerCount === 0) { window.addEventListener("message", onMessage, false);
window.removeEventListener("message", onMessage); }
} listenerCount += 1;
if (listenerCount < 0) { }
// Make an error so we get a stack trace
const e = new Error(
"ScalarMessaging: mismatched startListening / stopListening detected." +
" Negative count",
);
console.error(e);
}
},
setOpenManagerUrl: function(url) { export function stopListening() {
openManagerUrl = url; listenerCount -= 1;
}, if (listenerCount === 0) {
}; window.removeEventListener("message", onMessage);
}
if (listenerCount < 0) {
// Make an error so we get a stack trace
const e = new Error(
"ScalarMessaging: mismatched startListening / stopListening detected." +
" Negative count",
);
console.error(e);
}
}
export function setOpenManagerUrl(url) {
openManagerUrl = url;
}

View file

@ -106,5 +106,5 @@ class Skinner {
if (global.mxSkinner === undefined) { if (global.mxSkinner === undefined) {
global.mxSkinner = new Skinner(); global.mxSkinner = new Skinner();
} }
module.exports = global.mxSkinner; export default global.mxSkinner;

View file

@ -620,10 +620,8 @@ for (const evType of ALL_RULE_TYPES) {
stateHandlers[evType] = textForMjolnirEvent; stateHandlers[evType] = textForMjolnirEvent;
} }
module.exports = { export function textForEvent(ev) {
textForEvent: function(ev) { const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()]; if (handler) return handler(ev);
if (handler) return handler(ev); return '';
return ''; }
},
};

View file

@ -18,76 +18,74 @@ import {MatrixClientPeg} from "./MatrixClientPeg";
import shouldHideEvent from './shouldHideEvent'; import shouldHideEvent from './shouldHideEvent';
import * as sdk from "./index"; import * as sdk from "./index";
module.exports = { /**
/** * Returns true iff this event arriving in a room should affect the room's
* Returns true iff this event arriving in a room should affect the room's * count of unread messages
* count of unread messages */
*/ export function eventTriggersUnreadCount(ev) {
eventTriggersUnreadCount: function(ev) { if (ev.sender && ev.sender.userId == MatrixClientPeg.get().credentials.userId) {
if (ev.sender && ev.sender.userId == MatrixClientPeg.get().credentials.userId) { return false;
return false; } else if (ev.getType() == 'm.room.member') {
} else if (ev.getType() == 'm.room.member') { return false;
return false; } else if (ev.getType() == 'm.room.third_party_invite') {
} else if (ev.getType() == 'm.room.third_party_invite') { return false;
return false; } else if (ev.getType() == 'm.call.answer' || ev.getType() == 'm.call.hangup') {
} else if (ev.getType() == 'm.call.answer' || ev.getType() == 'm.call.hangup') { return false;
return false; } else if (ev.getType() == 'm.room.message' && ev.getContent().msgtype == 'm.notify') {
} else if (ev.getType() == 'm.room.message' && ev.getContent().msgtype == 'm.notify') { return false;
return false; } else if (ev.getType() == 'm.room.aliases' || ev.getType() == 'm.room.canonical_alias') {
} else if (ev.getType() == 'm.room.aliases' || ev.getType() == 'm.room.canonical_alias') { return false;
return false; } else if (ev.getType() == 'm.room.server_acl') {
} else if (ev.getType() == 'm.room.server_acl') { return false;
}
const EventTile = sdk.getComponent('rooms.EventTile');
return EventTile.haveTileForEvent(ev);
}
export function doesRoomHaveUnreadMessages(room) {
const myUserId = MatrixClientPeg.get().credentials.userId;
// get the most recent read receipt sent by our account.
// N.B. this is NOT a read marker (RM, aka "read up to marker"),
// despite the name of the method :((
const readUpToId = room.getEventReadUpTo(myUserId);
// as we don't send RRs for our own messages, make sure we special case that
// if *we* sent the last message into the room, we consider it not unread!
// Should fix: https://github.com/vector-im/riot-web/issues/3263
// https://github.com/vector-im/riot-web/issues/2427
// ...and possibly some of the others at
// https://github.com/vector-im/riot-web/issues/3363
if (room.timeline.length &&
room.timeline[room.timeline.length - 1].sender &&
room.timeline[room.timeline.length - 1].sender.userId === myUserId) {
return false;
}
// this just looks at whatever history we have, which if we've only just started
// up probably won't be very much, so if the last couple of events are ones that
// don't count, we don't know if there are any events that do count between where
// we have and the read receipt. We could fetch more history to try & find out,
// but currently we just guess.
// Loop through messages, starting with the most recent...
for (let i = room.timeline.length - 1; i >= 0; --i) {
const ev = room.timeline[i];
if (ev.getId() == readUpToId) {
// If we've read up to this event, there's nothing more recent
// that counts and we can stop looking because the user's read
// this and everything before.
return false; return false;
} else if (!shouldHideEvent(ev) && eventTriggersUnreadCount(ev)) {
// We've found a message that counts before we hit
// the user's read receipt, so this room is definitely unread.
return true;
} }
const EventTile = sdk.getComponent('rooms.EventTile'); }
return EventTile.haveTileForEvent(ev); // If we got here, we didn't find a message that counted but didn't find
}, // the user's read receipt either, so we guess and say that the room is
// unread on the theory that false positives are better than false
doesRoomHaveUnreadMessages: function(room) { // negatives here.
const myUserId = MatrixClientPeg.get().credentials.userId; return true;
}
// get the most recent read receipt sent by our account.
// N.B. this is NOT a read marker (RM, aka "read up to marker"),
// despite the name of the method :((
const readUpToId = room.getEventReadUpTo(myUserId);
// as we don't send RRs for our own messages, make sure we special case that
// if *we* sent the last message into the room, we consider it not unread!
// Should fix: https://github.com/vector-im/riot-web/issues/3263
// https://github.com/vector-im/riot-web/issues/2427
// ...and possibly some of the others at
// https://github.com/vector-im/riot-web/issues/3363
if (room.timeline.length &&
room.timeline[room.timeline.length - 1].sender &&
room.timeline[room.timeline.length - 1].sender.userId === myUserId) {
return false;
}
// this just looks at whatever history we have, which if we've only just started
// up probably won't be very much, so if the last couple of events are ones that
// don't count, we don't know if there are any events that do count between where
// we have and the read receipt. We could fetch more history to try & find out,
// but currently we just guess.
// Loop through messages, starting with the most recent...
for (let i = room.timeline.length - 1; i >= 0; --i) {
const ev = room.timeline[i];
if (ev.getId() == readUpToId) {
// If we've read up to this event, there's nothing more recent
// that counts and we can stop looking because the user's read
// this and everything before.
return false;
} else if (!shouldHideEvent(ev) && this.eventTriggersUnreadCount(ev)) {
// We've found a message that counts before we hit
// the user's read receipt, so this room is definitely unread.
return true;
}
}
// If we got here, we didn't find a message that counted but didn't find
// the user's read receipt either, so we guess and say that the room is
// unread on the theory that false positives are better than false
// negatives here.
return true;
},
};

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -28,10 +29,10 @@ import {MatrixClientPeg} from "./MatrixClientPeg";
const USER_PREFIX = "fs_"; const USER_PREFIX = "fs_";
const DOMAIN = "matrix.org"; const DOMAIN = "matrix.org";
function ConferenceCall(matrixClient, groupChatRoomId) { export function ConferenceCall(matrixClient, groupChatRoomId) {
this.client = matrixClient; this.client = matrixClient;
this.groupRoomId = groupChatRoomId; this.groupRoomId = groupChatRoomId;
this.confUserId = module.exports.getConferenceUserIdForRoom(this.groupRoomId); this.confUserId = getConferenceUserIdForRoom(this.groupRoomId);
} }
ConferenceCall.prototype.setup = function() { ConferenceCall.prototype.setup = function() {
@ -90,7 +91,7 @@ ConferenceCall.prototype._getConferenceUserRoom = function() {
* @param {string} userId The user ID to check. * @param {string} userId The user ID to check.
* @return {boolean} True if it is a conference bot. * @return {boolean} True if it is a conference bot.
*/ */
module.exports.isConferenceUser = function(userId) { export function isConferenceUser(userId) {
if (userId.indexOf("@" + USER_PREFIX) !== 0) { if (userId.indexOf("@" + USER_PREFIX) !== 0) {
return false; return false;
} }
@ -101,26 +102,26 @@ module.exports.isConferenceUser = function(userId) {
return /^!.+:.+/.test(decoded); return /^!.+:.+/.test(decoded);
} }
return false; return false;
}; }
module.exports.getConferenceUserIdForRoom = function(roomId) { export function getConferenceUserIdForRoom(roomId) {
// abuse browserify's core node Buffer support (strip padding ='s) // abuse browserify's core node Buffer support (strip padding ='s)
const base64RoomId = new Buffer(roomId).toString("base64").replace(/=/g, ""); const base64RoomId = new Buffer(roomId).toString("base64").replace(/=/g, "");
return "@" + USER_PREFIX + base64RoomId + ":" + DOMAIN; return "@" + USER_PREFIX + base64RoomId + ":" + DOMAIN;
}; }
module.exports.createNewMatrixCall = function(client, roomId) { export function createNewMatrixCall(client, roomId) {
const confCall = new ConferenceCall( const confCall = new ConferenceCall(
client, roomId, client, roomId,
); );
return confCall.setup(); return confCall.setup();
}; }
module.exports.getConferenceCallForRoom = function(roomId) { export function getConferenceCallForRoom(roomId) {
// search for a conference 1:1 call for this group chat room ID // search for a conference 1:1 call for this group chat room ID
const activeCall = CallHandler.getAnyActiveCall(); const activeCall = CallHandler.getAnyActiveCall();
if (activeCall && activeCall.confUserId) { if (activeCall && activeCall.confUserId) {
const thisRoomConfUserId = module.exports.getConferenceUserIdForRoom( const thisRoomConfUserId = getConferenceUserIdForRoom(
roomId, roomId,
); );
if (thisRoomConfUserId === activeCall.confUserId) { if (thisRoomConfUserId === activeCall.confUserId) {
@ -128,8 +129,7 @@ module.exports.getConferenceCallForRoom = function(roomId) {
} }
} }
return null; return null;
}; }
module.exports.ConferenceCall = ConferenceCall; // TODO: Document this.
export const slot = 'conference';
module.exports.slot = 'conference';

View file

@ -17,68 +17,66 @@ limitations under the License.
import {MatrixClientPeg} from "./MatrixClientPeg"; import {MatrixClientPeg} from "./MatrixClientPeg";
import { _t } from './languageHandler'; import { _t } from './languageHandler';
module.exports = { export function usersTypingApartFromMeAndIgnored(room) {
usersTypingApartFromMeAndIgnored: function(room) { return usersTyping(
return this.usersTyping( room, [MatrixClientPeg.get().credentials.userId].concat(MatrixClientPeg.get().getIgnoredUsers()),
room, [MatrixClientPeg.get().credentials.userId].concat(MatrixClientPeg.get().getIgnoredUsers()), );
); }
},
usersTypingApartFromMe: function(room) { export function usersTypingApartFromMe(room) {
return this.usersTyping( return usersTyping(
room, [MatrixClientPeg.get().credentials.userId], room, [MatrixClientPeg.get().credentials.userId],
); );
}, }
/** /**
* Given a Room object and, optionally, a list of userID strings * Given a Room object and, optionally, a list of userID strings
* to exclude, return a list of user objects who are typing. * to exclude, return a list of user objects who are typing.
* @param {Room} room: room object to get users from. * @param {Room} room: room object to get users from.
* @param {string[]} exclude: list of user mxids to exclude. * @param {string[]} exclude: list of user mxids to exclude.
* @returns {string[]} list of user objects who are typing. * @returns {string[]} list of user objects who are typing.
*/ */
usersTyping: function(room, exclude) { export function usersTyping(room, exclude) {
const whoIsTyping = []; const whoIsTyping = [];
if (exclude === undefined) { if (exclude === undefined) {
exclude = []; exclude = [];
} }
const memberKeys = Object.keys(room.currentState.members); const memberKeys = Object.keys(room.currentState.members);
for (let i = 0; i < memberKeys.length; ++i) { for (let i = 0; i < memberKeys.length; ++i) {
const userId = memberKeys[i]; const userId = memberKeys[i];
if (room.currentState.members[userId].typing) { if (room.currentState.members[userId].typing) {
if (exclude.indexOf(userId) === -1) { if (exclude.indexOf(userId) === -1) {
whoIsTyping.push(room.currentState.members[userId]); whoIsTyping.push(room.currentState.members[userId]);
}
} }
} }
}
return whoIsTyping; return whoIsTyping;
}, }
whoIsTypingString: function(whoIsTyping, limit) { export function whoIsTypingString(whoIsTyping, limit) {
let othersCount = 0; let othersCount = 0;
if (whoIsTyping.length > limit) { if (whoIsTyping.length > limit) {
othersCount = whoIsTyping.length - limit + 1; othersCount = whoIsTyping.length - limit + 1;
} }
if (whoIsTyping.length === 0) { if (whoIsTyping.length === 0) {
return ''; return '';
} else if (whoIsTyping.length === 1) { } else if (whoIsTyping.length === 1) {
return _t('%(displayName)s is typing …', {displayName: whoIsTyping[0].name}); return _t('%(displayName)s is typing …', {displayName: whoIsTyping[0].name});
} }
const names = whoIsTyping.map(function(m) { const names = whoIsTyping.map(function(m) {
return m.name; return m.name;
});
if (othersCount>=1) {
return _t('%(names)s and %(count)s others are typing …', {
names: names.slice(0, limit - 1).join(', '),
count: othersCount,
}); });
if (othersCount>=1) { } else {
return _t('%(names)s and %(count)s others are typing …', { const lastPerson = names.pop();
names: names.slice(0, limit - 1).join(', '), return _t('%(names)s and %(lastPerson)s are typing …', {names: names.join(', '), lastPerson: lastPerson});
count: othersCount, }
}); }
} else {
const lastPerson = names.pop();
return _t('%(names)s and %(lastPerson)s are typing …', {names: names.join(', '), lastPerson: lastPerson});
}
},
};

View file

@ -22,7 +22,7 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg";
const sdk = require('../../../index'); const sdk = require('../../../index');
module.exports = createReactClass({ export default createReactClass({
displayName: 'EncryptedEventDialog', displayName: 'EncryptedEventDialog',
propTypes: { propTypes: {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -20,7 +21,7 @@ import createReactClass from 'create-react-class';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { _t } from '../../languageHandler'; import { _t } from '../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'CompatibilityPage', displayName: 'CompatibilityPage',
propTypes: { propTypes: {
onAccept: PropTypes.func, onAccept: PropTypes.func,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -126,4 +127,4 @@ const FilePanel = createReactClass({
}, },
}); });
module.exports = FilePanel; export default FilePanel;

View file

@ -308,4 +308,4 @@ const LeftPanel = createReactClass({
}, },
}); });
module.exports = LeftPanel; export default LeftPanel;

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2019 New Vector Ltd Copyright 2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -60,4 +61,4 @@ const NotificationPanel = createReactClass({
}, },
}); });
module.exports = NotificationPanel; export default NotificationPanel;

View file

@ -36,7 +36,7 @@ function track(action) {
Analytics.trackEvent('RoomDirectory', action); Analytics.trackEvent('RoomDirectory', action);
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomDirectory', displayName: 'RoomDirectory',
propTypes: { propTypes: {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017, 2018 New Vector Ltd Copyright 2017, 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -38,7 +39,7 @@ function getUnsentMessages(room) {
}); });
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomStatusBar', displayName: 'RoomStatusBar',
propTypes: { propTypes: {

View file

@ -66,13 +66,13 @@ if (DEBUG) {
debuglog = console.log.bind(console); debuglog = console.log.bind(console);
} }
const RoomContext = PropTypes.shape({ export const RoomContext = PropTypes.shape({
canReact: PropTypes.bool.isRequired, canReact: PropTypes.bool.isRequired,
canReply: PropTypes.bool.isRequired, canReply: PropTypes.bool.isRequired,
room: PropTypes.instanceOf(Room), room: PropTypes.instanceOf(Room),
}); });
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomView', displayName: 'RoomView',
propTypes: { propTypes: {
ConferenceHandler: PropTypes.any, ConferenceHandler: PropTypes.any,
@ -2002,5 +2002,3 @@ module.exports = createReactClass({
); );
}, },
}); });
module.exports.RoomContext = RoomContext;

View file

@ -84,7 +84,7 @@ if (DEBUG_SCROLL) {
* offset as normal. * offset as normal.
*/ */
module.exports = createReactClass({ export default createReactClass({
displayName: 'ScrollPanel', displayName: 'ScrollPanel',
propTypes: { propTypes: {

View file

@ -24,7 +24,7 @@ import { throttle } from 'lodash';
import AccessibleButton from '../../components/views/elements/AccessibleButton'; import AccessibleButton from '../../components/views/elements/AccessibleButton';
import classNames from 'classnames'; import classNames from 'classnames';
module.exports = createReactClass({ export default createReactClass({
displayName: 'SearchBox', displayName: 'SearchBox',
propTypes: { propTypes: {

View file

@ -1344,4 +1344,4 @@ const TimelinePanel = createReactClass({
}, },
}); });
module.exports = TimelinePanel; export default TimelinePanel;

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -22,7 +23,7 @@ import dis from "../../dispatcher";
import filesize from "filesize"; import filesize from "filesize";
import { _t } from '../../languageHandler'; import { _t } from '../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'UploadBar', displayName: 'UploadBar',
propTypes: { propTypes: {
room: PropTypes.object, room: PropTypes.object,

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -23,7 +24,7 @@ import {_t} from "../../languageHandler";
import * as sdk from "../../index"; import * as sdk from "../../index";
module.exports = createReactClass({ export default createReactClass({
displayName: 'ViewSource', displayName: 'ViewSource',
propTypes: { propTypes: {

View file

@ -40,7 +40,7 @@ const PHASE_EMAIL_SENT = 3;
// User has clicked the link in email and completed reset // User has clicked the link in email and completed reset
const PHASE_DONE = 4; const PHASE_DONE = 4;
module.exports = createReactClass({ export default createReactClass({
displayName: 'ForgotPassword', displayName: 'ForgotPassword',
propTypes: { propTypes: {

View file

@ -54,7 +54,7 @@ _td("General failure");
/** /**
* A wire component which glues together login UI components and Login logic * A wire component which glues together login UI components and Login logic
*/ */
module.exports = createReactClass({ export default createReactClass({
displayName: 'Login', displayName: 'Login',
propTypes: { propTypes: {

View file

@ -22,7 +22,7 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import AuthPage from "../../views/auth/AuthPage"; import AuthPage from "../../views/auth/AuthPage";
module.exports = createReactClass({ export default createReactClass({
displayName: 'PostRegistration', displayName: 'PostRegistration',
propTypes: { propTypes: {

View file

@ -41,7 +41,7 @@ const PHASE_REGISTRATION = 1;
// Enable phases for registration // Enable phases for registration
const PHASES_ENABLED = true; const PHASES_ENABLED = true;
module.exports = createReactClass({ export default createReactClass({
displayName: 'Registration', displayName: 'Registration',
propTypes: { propTypes: {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 New Vector Ltd Copyright 2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import { _t } from '../../../languageHandler';
import React from 'react'; import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'AuthFooter', displayName: 'AuthFooter',
render: function() { render: function() {

View file

@ -19,7 +19,7 @@ import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
module.exports = createReactClass({ export default createReactClass({
displayName: 'AuthHeader', displayName: 'AuthHeader',
render: function() { render: function() {

View file

@ -24,7 +24,7 @@ const DIV_ID = 'mx_recaptcha';
/** /**
* A pure UI component which displays a captcha form. * A pure UI component which displays a captcha form.
*/ */
module.exports = createReactClass({ export default createReactClass({
displayName: 'CaptchaForm', displayName: 'CaptchaForm',
propTypes: { propTypes: {

View file

@ -19,7 +19,7 @@ import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'CustomServerDialog', displayName: 'CustomServerDialog',
render: function() { render: function() {

View file

@ -41,7 +41,7 @@ const PASSWORD_MIN_SCORE = 3; // safely unguessable: moderate protection from of
/** /**
* A pure UI component which displays a registration form. * A pure UI component which displays a registration form.
*/ */
module.exports = createReactClass({ export default createReactClass({
displayName: 'RegistrationForm', displayName: 'RegistrationForm',
propTypes: { propTypes: {

View file

@ -2,6 +2,7 @@
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2018 New Vector Ltd Copyright 2018 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -24,7 +25,7 @@ import * as AvatarLogic from '../../../Avatar';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
module.exports = createReactClass({ export default createReactClass({
displayName: 'BaseAvatar', displayName: 'BaseAvatar',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -21,7 +22,7 @@ import * as Avatar from '../../../Avatar';
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import dis from "../../../dispatcher"; import dis from "../../../dispatcher";
module.exports = createReactClass({ export default createReactClass({
displayName: 'MemberAvatar', displayName: 'MemberAvatar',
propTypes: { propTypes: {

View file

@ -22,7 +22,7 @@ import Modal from '../../../Modal';
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import * as Avatar from '../../../Avatar'; import * as Avatar from '../../../Avatar';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomAvatar', displayName: 'RoomAvatar',
// Room may be left unset here, but if it is, // Room may be left unset here, but if it is,

View file

@ -37,7 +37,7 @@ function canCancel(eventStatus) {
return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT; return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT;
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'MessageContextMenu', displayName: 'MessageContextMenu',
propTypes: { propTypes: {

View file

@ -63,7 +63,7 @@ const NotifOption = ({active, onClick, src, label}) => {
); );
}; };
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomTileContextMenu', displayName: 'RoomTileContextMenu',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'CreateRoomButton', displayName: 'CreateRoomButton',
propTypes: { propTypes: {
onCreateRoom: PropTypes.func, onCreateRoom: PropTypes.func,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -25,7 +26,7 @@ const Presets = {
Custom: "custom", Custom: "custom",
}; };
module.exports = createReactClass({ export default createReactClass({
displayName: 'CreateRoomPresets', displayName: 'CreateRoomPresets',
propTypes: { propTypes: {
onChange: PropTypes.func, onChange: PropTypes.func,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomAlias', displayName: 'RoomAlias',
propTypes: { propTypes: {
// Specifying a homeserver will make magical things happen when you, // Specifying a homeserver will make magical things happen when you,

View file

@ -43,7 +43,7 @@ const addressTypeName = {
}; };
module.exports = createReactClass({ export default createReactClass({
displayName: "AddressPickerDialog", displayName: "AddressPickerDialog",
propTypes: { propTypes: {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2017 Aidan Gauland Copyright 2017 Aidan Gauland
Copyright 2018 New Vector Ltd. Copyright 2018 New Vector Ltd.
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -23,7 +24,7 @@ import { _t } from '../../../languageHandler';
/** /**
* Basic container for buttons in modal dialogs. * Basic container for buttons in modal dialogs.
*/ */
module.exports = createReactClass({ export default createReactClass({
displayName: "DialogButtons", displayName: "DialogButtons",
propTypes: { propTypes: {

View file

@ -20,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import {Key} from "../../../Keyboard"; import {Key} from "../../../Keyboard";
module.exports = createReactClass({ export default createReactClass({
displayName: 'EditableText', displayName: 'EditableText',
propTypes: { propTypes: {

View file

@ -17,7 +17,7 @@ limitations under the License.
import React from "react"; import React from "react";
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'InlineSpinner', displayName: 'InlineSpinner',
render: function() { render: function() {

View file

@ -24,7 +24,7 @@ import { formatCommaSeparatedList } from '../../../utils/FormattingUtils';
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import {MatrixEvent} from "matrix-js-sdk"; import {MatrixEvent} from "matrix-js-sdk";
module.exports = createReactClass({ export default createReactClass({
displayName: 'MemberEventListSummary', displayName: 'MemberEventListSummary',
propTypes: { propTypes: {

View file

@ -17,7 +17,7 @@ limitations under the License.
import React from 'react'; import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'MessageSpinner', displayName: 'MessageSpinner',
render: function() { render: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2018 New Vector Ltd Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -22,7 +23,7 @@ import WidgetUtils from '../../../utils/WidgetUtils';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {MatrixClientPeg} from '../../../MatrixClientPeg';
module.exports = createReactClass({ export default createReactClass({
displayName: 'PersistentApp', displayName: 'PersistentApp',
getInitialState: function() { getInitialState: function() {

View file

@ -22,7 +22,7 @@ import { _t } from '../../../languageHandler';
import Field from "./Field"; import Field from "./Field";
import {Key} from "../../../Keyboard"; import {Key} from "../../../Keyboard";
module.exports = createReactClass({ export default createReactClass({
displayName: 'PowerSelector', displayName: 'PowerSelector',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -18,7 +19,7 @@ import React from "react";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'ProgressBar', displayName: 'ProgressBar',
propTypes: { propTypes: {
value: PropTypes.number, value: PropTypes.number,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2017 Travis Ralston Copyright 2017 Travis Ralston
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -21,7 +22,7 @@ import SettingsStore from "../../../settings/SettingsStore";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import ToggleSwitch from "./ToggleSwitch"; import ToggleSwitch from "./ToggleSwitch";
module.exports = createReactClass({ export default createReactClass({
displayName: 'SettingsFlag', displayName: 'SettingsFlag',
propTypes: { propTypes: {
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -17,7 +18,7 @@ limitations under the License.
import React from "react"; import React from "react";
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'Spinner', displayName: 'Spinner',
render: function() { render: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015 OpenMarket Ltd Copyright 2015 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -83,4 +84,4 @@ Tinter.registerTintable(function() {
} }
}); });
module.exports = TintableSvg; export default TintableSvg;

View file

@ -2,6 +2,7 @@
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 New Vector Ltd Copyright 2019 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -26,7 +27,7 @@ import classNames from 'classnames';
const MIN_TOOLTIP_HEIGHT = 25; const MIN_TOOLTIP_HEIGHT = 25;
module.exports = createReactClass({ export default createReactClass({
displayName: 'Tooltip', displayName: 'Tooltip',
propTypes: { propTypes: {

View file

@ -19,7 +19,7 @@ import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
module.exports = createReactClass({ export default createReactClass({
displayName: 'TooltipButton', displayName: 'TooltipButton',
getInitialState: function() { getInitialState: function() {

View file

@ -20,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'TruncatedList', displayName: 'TruncatedList',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'UserSelector', displayName: 'UserSelector',
propTypes: { propTypes: {

View file

@ -20,7 +20,7 @@ import { _t } from '../../../languageHandler';
import Notifier from '../../../Notifier'; import Notifier from '../../../Notifier';
import AccessibleButton from '../../../components/views/elements/AccessibleButton'; import AccessibleButton from '../../../components/views/elements/AccessibleButton';
module.exports = createReactClass({ export default createReactClass({
displayName: 'MatrixToolbar', displayName: 'MatrixToolbar',
hideToolbar: function() { hideToolbar: function() {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2017 Vector Creations Ltd Copyright 2017 Vector Creations Ltd
Copyright 2017 New Vector Ltd Copyright 2017 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -27,7 +28,7 @@ import { GroupMemberType } from '../../../groups';
import GroupStore from '../../../stores/GroupStore'; import GroupStore from '../../../stores/GroupStore';
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
module.exports = createReactClass({ export default createReactClass({
displayName: 'GroupMemberInfo', displayName: 'GroupMemberInfo',
contextTypes: { contextTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2017 New Vector Ltd Copyright 2017 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -24,7 +25,7 @@ import * as sdk from '../../../index';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import GroupStore from '../../../stores/GroupStore'; import GroupStore from '../../../stores/GroupStore';
module.exports = createReactClass({ export default createReactClass({
displayName: 'GroupRoomInfo', displayName: 'GroupRoomInfo',
contextTypes: { contextTypes: {

View file

@ -194,7 +194,7 @@ function computedStyle(element) {
return cssText; return cssText;
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'MFileBody', displayName: 'MFileBody',
getInitialState: function() { getInitialState: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -23,7 +24,7 @@ import { decryptFile } from '../../../utils/DecryptFile';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
module.exports = createReactClass({ export default createReactClass({
displayName: 'MVideoBody', displayName: 'MVideoBody',
propTypes: { propTypes: {

View file

@ -21,7 +21,7 @@ import * as sdk from '../../../index';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
import {Mjolnir} from "../../../mjolnir/Mjolnir"; import {Mjolnir} from "../../../mjolnir/Mjolnir";
module.exports = createReactClass({ export default createReactClass({
displayName: 'MessageEvent', displayName: 'MessageEvent',
propTypes: { propTypes: {

View file

@ -1,6 +1,7 @@
/* /*
Copyright 2017 Vector Creations Ltd Copyright 2017 Vector Creations Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -24,7 +25,7 @@ import * as sdk from '../../../index';
import Modal from '../../../Modal'; import Modal from '../../../Modal';
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomAvatarEvent', displayName: 'RoomAvatarEvent',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2018 New Vector Ltd Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -23,7 +24,7 @@ import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {MatrixClientPeg} from '../../../MatrixClientPeg';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomCreate', displayName: 'RoomCreate',
propTypes: { propTypes: {

View file

@ -35,7 +35,7 @@ import {IntegrationManagers} from "../../../integrations/IntegrationManagers";
import {isPermalinkHost} from "../../../utils/permalinks/Permalinks"; import {isPermalinkHost} from "../../../utils/permalinks/Permalinks";
import {toRightOf} from "../../structures/ContextMenu"; import {toRightOf} from "../../structures/ContextMenu";
module.exports = createReactClass({ export default createReactClass({
displayName: 'TextualBody', displayName: 'TextualBody',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import * as TextForEvent from "../../../TextForEvent"; import * as TextForEvent from "../../../TextForEvent";
module.exports = createReactClass({ export default createReactClass({
displayName: 'TextualEvent', displayName: 'TextualEvent',
propTypes: { propTypes: {

View file

@ -18,7 +18,7 @@ import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'UnknownBody', displayName: 'UnknownBody',
render: function() { render: function() {

View file

@ -40,7 +40,7 @@ const ROOM_COLORS = [
// has a high possibility of being used in the nearish future. // has a high possibility of being used in the nearish future.
// Ref: https://github.com/vector-im/riot-web/issues/8421 // Ref: https://github.com/vector-im/riot-web/issues/8421
module.exports = createReactClass({ export default createReactClass({
displayName: 'ColorSettings', displayName: 'ColorSettings',
propTypes: { propTypes: {

View file

@ -1,7 +1,8 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2017 Travis Ralston Copyright 2017 Travis Ralston
Copyright 2018-2019 New Vector Ltd Copyright 2018, 2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -26,7 +27,7 @@ import dis from "../../../dispatcher";
import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {MatrixClientPeg} from "../../../MatrixClientPeg";
module.exports = createReactClass({ export default createReactClass({
displayName: 'UrlPreviewSettings', displayName: 'UrlPreviewSettings',
propTypes: { propTypes: {

View file

@ -34,7 +34,7 @@ import SettingsStore from "../../../settings/SettingsStore";
// The maximum number of widgets that can be added in a room // The maximum number of widgets that can be added in a room
const MAX_WIDGETS = 2; const MAX_WIDGETS = 2;
module.exports = createReactClass({ export default createReactClass({
displayName: 'AppsDrawer', displayName: 'AppsDrawer',
propTypes: { propTypes: {

View file

@ -29,7 +29,7 @@ import RateLimitedFunc from '../../../ratelimitedfunc';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
module.exports = createReactClass({ export default createReactClass({
displayName: 'AuxPanel', displayName: 'AuxPanel',
propTypes: { propTypes: {

View file

@ -71,7 +71,7 @@ for (const evType of ALL_RULE_TYPES) {
stateEventTileTypes[evType] = 'messages.TextualEvent'; stateEventTileTypes[evType] = 'messages.TextualEvent';
} }
function getHandlerTile(ev) { export function getHandlerTile(ev) {
const type = ev.getType(); const type = ev.getType();
// don't show verification requests we're not involved in, // don't show verification requests we're not involved in,
@ -114,7 +114,7 @@ const MAX_READ_AVATARS = 5;
// | '--------------------------------------' | // | '--------------------------------------' |
// '----------------------------------------------------------' // '----------------------------------------------------------'
module.exports = createReactClass({ export default createReactClass({
displayName: 'EventTile', displayName: 'EventTile',
propTypes: { propTypes: {
@ -875,7 +875,7 @@ function isMessageEvent(ev) {
return (messageTypes.includes(ev.getType())); return (messageTypes.includes(ev.getType()));
} }
module.exports.haveTileForEvent = function(e) { export function haveTileForEvent(e) {
// Only messages have a tile (black-rectangle) if redacted // Only messages have a tile (black-rectangle) if redacted
if (e.isRedacted() && !isMessageEvent(e)) return false; if (e.isRedacted() && !isMessageEvent(e)) return false;
@ -891,7 +891,7 @@ module.exports.haveTileForEvent = function(e) {
} else { } else {
return true; return true;
} }
}; }
function E2ePadlockUndecryptable(props) { function E2ePadlockUndecryptable(props) {
return ( return (
@ -960,5 +960,3 @@ class E2ePadlock extends React.Component {
); );
} }
} }
module.exports.getHandlerTile = getHandlerTile;

View file

@ -23,7 +23,7 @@ import dis from '../../../dispatcher';
import { KeyCode } from '../../../Keyboard'; import { KeyCode } from '../../../Keyboard';
module.exports = createReactClass({ export default createReactClass({
displayName: 'ForwardMessage', displayName: 'ForwardMessage',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -24,7 +25,7 @@ import * as sdk from "../../../index";
import Modal from "../../../Modal"; import Modal from "../../../Modal";
import * as ImageUtils from "../../../ImageUtils"; import * as ImageUtils from "../../../ImageUtils";
module.exports = createReactClass({ export default createReactClass({
displayName: 'LinkPreviewWidget', displayName: 'LinkPreviewWidget',
propTypes: { propTypes: {

View file

@ -50,7 +50,7 @@ import AutoHideScrollbar from "../../structures/AutoHideScrollbar";
import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {MatrixClientPeg} from "../../../MatrixClientPeg";
import {EventTimeline} from "matrix-js-sdk"; import {EventTimeline} from "matrix-js-sdk";
module.exports = createReactClass({ export default createReactClass({
displayName: 'MemberInfo', displayName: 'MemberInfo',
propTypes: { propTypes: {

View file

@ -32,7 +32,7 @@ const INITIAL_LOAD_NUM_MEMBERS = 30;
const INITIAL_LOAD_NUM_INVITED = 5; const INITIAL_LOAD_NUM_INVITED = 5;
const SHOW_MORE_INCREMENT = 100; const SHOW_MORE_INCREMENT = 100;
module.exports = createReactClass({ export default createReactClass({
displayName: 'MemberList', displayName: 'MemberList',
getInitialState: function() { getInitialState: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -22,7 +23,7 @@ import * as sdk from "../../../index";
import dis from "../../../dispatcher"; import dis from "../../../dispatcher";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'MemberTile', displayName: 'MemberTile',
propTypes: { propTypes: {

View file

@ -25,7 +25,7 @@ import MemberAvatar from "../avatars/MemberAvatar";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import {formatFullDate} from '../../../DateUtils'; import {formatFullDate} from '../../../DateUtils';
module.exports = createReactClass({ export default createReactClass({
displayName: 'PinnedEventTile', displayName: 'PinnedEventTile',
propTypes: { propTypes: {
mxRoom: PropTypes.object.isRequired, mxRoom: PropTypes.object.isRequired,

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2017 Travis Ralston Copyright 2017 Travis Ralston
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -23,7 +24,7 @@ import PinnedEventTile from "./PinnedEventTile";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import PinningUtils from "../../../utils/PinningUtils"; import PinningUtils from "../../../utils/PinningUtils";
module.exports = createReactClass({ export default createReactClass({
displayName: 'PinnedEventsPanel', displayName: 'PinnedEventsPanel',
propTypes: { propTypes: {
// The Room from the js-sdk we're going to show pinned events for // The Room from the js-sdk we're going to show pinned events for

View file

@ -21,7 +21,7 @@ import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'PresenceLabel', displayName: 'PresenceLabel',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -32,7 +33,7 @@ try {
} catch (e) { } catch (e) {
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'ReadReceiptMarker', displayName: 'ReadReceiptMarker',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -17,7 +18,7 @@ limitations under the License.
import React from 'react'; import React from 'react';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomDropTarget', displayName: 'RoomDropTarget',
render: function() { render: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -32,7 +33,7 @@ import SettingsStore from "../../../settings/SettingsStore";
import RoomHeaderButtons from '../right_panel/RoomHeaderButtons'; import RoomHeaderButtons from '../right_panel/RoomHeaderButtons';
import E2EIcon from './E2EIcon'; import E2EIcon from './E2EIcon';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomHeader', displayName: 'RoomHeader',
propTypes: { propTypes: {

View file

@ -48,7 +48,7 @@ function labelForTagName(tagName) {
return tagName; return tagName;
} }
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomList', displayName: 'RoomList',
propTypes: { propTypes: {

View file

@ -21,7 +21,7 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg";
import * as sdk from "../../../index"; import * as sdk from "../../../index";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomNameEditor', displayName: 'RoomNameEditor',
propTypes: { propTypes: {

View file

@ -43,7 +43,7 @@ const MessageCase = Object.freeze({
OtherError: "OtherError", OtherError: "OtherError",
}); });
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomPreviewBar', displayName: 'RoomPreviewBar',
propTypes: { propTypes: {

View file

@ -33,7 +33,7 @@ import RoomViewStore from '../../../stores/RoomViewStore';
import SettingsStore from "../../../settings/SettingsStore"; import SettingsStore from "../../../settings/SettingsStore";
import {_t} from "../../../languageHandler"; import {_t} from "../../../languageHandler";
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomTile', displayName: 'RoomTile',
propTypes: { propTypes: {

View file

@ -20,7 +20,7 @@ import createReactClass from 'create-react-class';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
import { _t } from "../../../languageHandler"; import { _t } from "../../../languageHandler";
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomTopicEditor', displayName: 'RoomTopicEditor',
propTypes: { propTypes: {

View file

@ -23,7 +23,7 @@ import Modal from '../../../Modal';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {MatrixClientPeg} from "../../../MatrixClientPeg";
module.exports = createReactClass({ export default createReactClass({
displayName: 'RoomUpgradeWarningBar', displayName: 'RoomUpgradeWarningBar',
propTypes: { propTypes: {

View file

@ -20,7 +20,7 @@ import AccessibleButton from "../elements/AccessibleButton";
import classNames from "classnames"; import classNames from "classnames";
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
module.exports = createReactClass({ export default createReactClass({
displayName: 'SearchBar', displayName: 'SearchBar',
getInitialState: function() { getInitialState: function() {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015 OpenMarket Ltd Copyright 2015 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -19,7 +20,7 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class'; import createReactClass from 'create-react-class';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
module.exports = createReactClass({ export default createReactClass({
displayName: 'SearchResult', displayName: 'SearchResult',
propTypes: { propTypes: {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2015, 2016 OpenMarket Ltd Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -182,4 +183,4 @@ const SearchableEntityList = createReactClass({
}, },
}); });
module.exports = SearchableEntityList; export default SearchableEntityList;

Some files were not shown because too many files have changed in this diff Show more