Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2eac869

Browse files
committed
Merge branch 'develop' into rob/apps-not-e2ee
2 parents 7082496 + 388d814 commit 2eac869

File tree

4 files changed

+44
-39
lines changed

4 files changed

+44
-39
lines changed

src/TextForEvent.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,21 @@ function textForWidgetEvent(event) {
252252
const senderName = event.sender ? event.sender.name : event.getSender();
253253
const previousContent = event.getPrevContent() || {};
254254
const {name, type, url} = event.getContent() || {};
255-
let widgetName = widgetName || name || type || previousContent.type;
256-
widgetName = widgetName ? widgetName + ' ' : '';
255+
let widgetName = name || previousContent.name || type || previousContent.type || '';
256+
// Apply sentence case to widget name
257+
if (widgetName && widgetName.length > 0) {
258+
widgetName = widgetName[0].toUpperCase() + widgetName.slice(1) + ' ';
259+
}
257260

258261
// If the widget was removed, its content should be {}, but this is sufficiently
259262
// equivalent to that condition.
260263
if (url) {
261-
return _t('%(senderName)s added a %(widgetName)swidget', {
262-
senderName, widgetName,
264+
return _t('%(widgetName)s widget added by %(senderName)s', {
265+
widgetName, senderName,
263266
});
264267
} else {
265-
return _t('%(senderName)s removed a %(widgetName)swidget', {
266-
senderName, widgetName,
268+
return _t('%(widgetName)s widget removed by %(senderName)s', {
269+
widgetName, senderName,
267270
});
268271
}
269272
}

src/components/views/elements/AppTile.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -223,44 +223,46 @@ export default React.createClass({
223223
safeWidgetUrl = url.format(parsedWidgetUrl);
224224
}
225225

226-
if (this.state.loading) {
227-
appTileBody = (
228-
<div className='mx_AppTileBody mx_AppLoading'>
229-
<MessageSpinner msg='Loading...'/>
230-
</div>
231-
);
232-
} else if (this.state.hasPermissionToLoad == true) {
233-
if (this.isMixedContent()) {
226+
if (this.props.show) {
227+
if (this.state.loading) {
234228
appTileBody = (
235-
<div className="mx_AppTileBody">
236-
<AppWarning
237-
errorMsg="Error - Mixed content"
238-
/>
229+
<div className='mx_AppTileBody mx_AppLoading'>
230+
<MessageSpinner msg='Loading...'/>
239231
</div>
240232
);
241-
} else if (this.props.show) {
233+
} else if (this.state.hasPermissionToLoad == true) {
234+
if (this.isMixedContent()) {
235+
appTileBody = (
236+
<div className="mx_AppTileBody">
237+
<AppWarning
238+
errorMsg="Error - Mixed content"
239+
/>
240+
</div>
241+
);
242+
} else {
243+
appTileBody = (
244+
<div className="mx_AppTileBody">
245+
<iframe
246+
ref="appFrame"
247+
src={safeWidgetUrl}
248+
allowFullScreen="true"
249+
sandbox={sandboxFlags}
250+
></iframe>
251+
</div>
252+
);
253+
}
254+
} else {
255+
const isRoomEncrypted = MatrixClientPeg.get().isRoomEncrypted(this.props.room.roomId);
242256
appTileBody = (
243257
<div className="mx_AppTileBody">
244-
<iframe
245-
ref="appFrame"
246-
src={safeWidgetUrl}
247-
allowFullScreen="true"
248-
sandbox={sandboxFlags}
249-
></iframe>
258+
<AppPermission
259+
isRoomEncrypted={isRoomEncrypted}
260+
url={this.state.widgetUrl}
261+
onPermissionGranted={this._grantWidgetPermission}
262+
/>
250263
</div>
251264
);
252265
}
253-
} else {
254-
const isRoomEncrypted = MatrixClientPeg.get().isRoomEncrypted(this.props.room.roomId);
255-
appTileBody = (
256-
<div className="mx_AppTileBody">
257-
<AppPermission
258-
isRoomEncrypted={isRoomEncrypted}
259-
url={this.state.widgetUrl}
260-
onPermissionGranted={this._grantWidgetPermission}
261-
/>
262-
</div>
263-
);
264266
}
265267

266268
// editing is done in scalar

src/components/views/elements/Pill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const Pill = React.createClass({
171171
}
172172
pillClass = 'mx_UserPill';
173173
href = null;
174-
onClick = this.onUserPillClicked.bind(this);
174+
onClick = this.onUserPillClicked;
175175
}
176176
}
177177
break;

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@
972972
"Failed to upload image": "Failed to upload image",
973973
"Failed to update group": "Failed to update group",
974974
"Hide avatars in user and room mentions": "Hide avatars in user and room mentions",
975-
"%(senderName)s added a %(widgetName)swidget": "%(senderName)s added a %(widgetName)swidget",
976-
"%(senderName)s removed a %(widgetName)swidget": "%(senderName)s removed a %(widgetName)swidget",
975+
"%(widgetName)s widget added by %(senderName)s": "%(widgetName)s widget added by %(senderName)s",
976+
"%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s",
977977
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>"
978978
}

0 commit comments

Comments
 (0)