mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge remote-tracking branch 'origin/develop' into luke/improve-country-dd
This commit is contained in:
commit
c1336f09fe
6 changed files with 26 additions and 9 deletions
|
@ -111,8 +111,7 @@ var sanitizeHtmlParams = {
|
||||||
allowedTags: [
|
allowedTags: [
|
||||||
'font', // custom to matrix for IRC-style font coloring
|
'font', // custom to matrix for IRC-style font coloring
|
||||||
'del', // for markdown
|
'del', // for markdown
|
||||||
// deliberately no h1/h2 to stop people shouting.
|
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
|
||||||
'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
|
|
||||||
'nl', 'li', 'b', 'i', 'u', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
|
'nl', 'li', 'b', 'i', 'u', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
|
||||||
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'span',
|
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'span',
|
||||||
],
|
],
|
||||||
|
|
|
@ -14,7 +14,7 @@ let instance = null;
|
||||||
export default class EmojiProvider extends AutocompleteProvider {
|
export default class EmojiProvider extends AutocompleteProvider {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(EMOJI_REGEX);
|
super(EMOJI_REGEX);
|
||||||
this.fuse = new Fuse(EMOJI_SHORTNAMES);
|
this.fuse = new Fuse(EMOJI_SHORTNAMES, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCompletions(query: string, selection: SelectionRange) {
|
async getCompletions(query: string, selection: SelectionRange) {
|
||||||
|
|
|
@ -279,9 +279,7 @@ module.exports = React.createClass({
|
||||||
this.currentGhostEventId = null;
|
this.currentGhostEventId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isMembershipChange = (e) =>
|
var isMembershipChange = (e) => e.getType() === 'm.room.member';
|
||||||
e.getType() === 'm.room.member'
|
|
||||||
&& (!e.getPrevContent() || e.getContent().membership !== e.getPrevContent().membership);
|
|
||||||
|
|
||||||
for (i = 0; i < this.props.events.length; i++) {
|
for (i = 0; i < this.props.events.length; i++) {
|
||||||
var mxEv = this.props.events[i];
|
var mxEv = this.props.events[i];
|
||||||
|
|
|
@ -1280,7 +1280,8 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
// we want to show the bar if the read-marker is off the top of the
|
// we want to show the bar if the read-marker is off the top of the
|
||||||
// screen.
|
// screen.
|
||||||
var showBar = (pos < 0);
|
// If pos is null, the event might not be paginated, so show the unread bar!
|
||||||
|
var showBar = pos < 0 || pos === null;
|
||||||
|
|
||||||
if (this.state.showTopUnreadMessagesBar != showBar) {
|
if (this.state.showTopUnreadMessagesBar != showBar) {
|
||||||
this.setState({showTopUnreadMessagesBar: showBar},
|
this.setState({showTopUnreadMessagesBar: showBar},
|
||||||
|
|
|
@ -149,7 +149,7 @@ export default React.createClass({
|
||||||
>
|
>
|
||||||
<GeminiScrollbar autoshow={false} className="mx_Dialog_content">
|
<GeminiScrollbar autoshow={false} className="mx_Dialog_content">
|
||||||
<h4>
|
<h4>
|
||||||
This room contains devices that you haven't seen before.
|
"{this.props.room.name}" contains devices that you haven't seen before.
|
||||||
</h4>
|
</h4>
|
||||||
{ warning }
|
{ warning }
|
||||||
Unknown devices:
|
Unknown devices:
|
||||||
|
|
|
@ -221,6 +221,8 @@ module.exports = React.createClass({
|
||||||
"banned": beConjugated + " banned",
|
"banned": beConjugated + " banned",
|
||||||
"unbanned": beConjugated + " unbanned",
|
"unbanned": beConjugated + " unbanned",
|
||||||
"kicked": beConjugated + " kicked",
|
"kicked": beConjugated + " kicked",
|
||||||
|
"changed_name": "changed name",
|
||||||
|
"changed_avatar": "changed avatar",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Object.keys(map).includes(t)) {
|
if (Object.keys(map).includes(t)) {
|
||||||
|
@ -289,7 +291,24 @@ module.exports = React.createClass({
|
||||||
switch (e.mxEvent.getContent().membership) {
|
switch (e.mxEvent.getContent().membership) {
|
||||||
case 'invite': return 'invited';
|
case 'invite': return 'invited';
|
||||||
case 'ban': return 'banned';
|
case 'ban': return 'banned';
|
||||||
case 'join': return 'joined';
|
case 'join':
|
||||||
|
if (e.mxEvent.getPrevContent().membership === 'join') {
|
||||||
|
if (e.mxEvent.getContent().displayname !==
|
||||||
|
e.mxEvent.getPrevContent().displayname)
|
||||||
|
{
|
||||||
|
return 'changed_name';
|
||||||
|
}
|
||||||
|
else if (e.mxEvent.getContent().avatar_url !==
|
||||||
|
e.mxEvent.getPrevContent().avatar_url)
|
||||||
|
{
|
||||||
|
return 'changed_avatar';
|
||||||
|
}
|
||||||
|
// console.log("MELS ignoring duplicate membership join event");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 'joined';
|
||||||
|
}
|
||||||
case 'leave':
|
case 'leave':
|
||||||
if (e.mxEvent.getSender() === e.mxEvent.getStateKey()) {
|
if (e.mxEvent.getSender() === e.mxEvent.getStateKey()) {
|
||||||
switch (e.mxEvent.getPrevContent().membership) {
|
switch (e.mxEvent.getPrevContent().membership) {
|
||||||
|
|
Loading…
Reference in a new issue