bug fixed
This commit is contained in:
parent
415de783c0
commit
c294cc66b5
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ucap-webmessenger",
|
"name": "ucap-webmessenger",
|
||||||
"version": "0.0.5",
|
"version": "0.0.9",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -36,6 +36,7 @@ import {
|
||||||
of,
|
of,
|
||||||
BehaviorSubject
|
BehaviorSubject
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Info,
|
Info,
|
||||||
EventType,
|
EventType,
|
||||||
|
@ -472,14 +473,14 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
return this.loginResSubject.value.userSeq !== roomUserInfo.seq;
|
return this.loginResSubject.value.userSeq !== roomUserInfo.seq;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return this.userInfoListSubject.value
|
return this.userInfoListSubject.value
|
||||||
.filter(roomUserInfo => {
|
.filter(roomUserInfo => {
|
||||||
return (
|
return (
|
||||||
this.loginResSubject.value.userSeq !== roomUserInfo.seq &&
|
this.loginResSubject.value.userSeq !== roomUserInfo.seq &&
|
||||||
roomUserInfo.isJoinRoom
|
roomUserInfo.isJoinRoom
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,7 +734,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||||
eventType: EventType.MassText,
|
eventType: EventType.MassText,
|
||||||
// sentMessage: message.replace(/\n/gi, '\r\n')
|
// sentMessage: message.replace(/\n/gi, '\r\n')
|
||||||
sentMessage: message
|
sentMessage: StringUtil.escapeHtml(message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -236,4 +236,18 @@ export class StringUtil {
|
||||||
}
|
}
|
||||||
return eventMessage;
|
return eventMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static escapeHtml(dirty: string): string {
|
||||||
|
return (dirty + '').replace(
|
||||||
|
/[&<>"']/g,
|
||||||
|
m =>
|
||||||
|
({
|
||||||
|
'&': '&',
|
||||||
|
'<': '<',
|
||||||
|
'>': '>',
|
||||||
|
'"': '"',
|
||||||
|
"'": '''
|
||||||
|
}[m])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user