-
+
+
+
+
+
+
[];
+ roomInfo: RoomInfo;
+ @Input()
+ set eventList(elist: Info[]) {
+ if (!!elist && elist.length > 0) {
+ this.firstEventSeq = elist[0].seq;
+ this.lastEventSeq = elist[elist.length - 1].seq;
+ }
+
+ this.messages = elist;
+ }
@Input()
eventInfoStatus?: InfoResponse;
@Input()
@@ -44,6 +45,10 @@ export class MessagesComponent implements OnInit {
sessionVerInfo: VersionInfo2Response;
@Input()
isShowUnreadCount = true;
+ @Input()
+ clearReadHere: boolean;
+ @Input()
+ minShowReadHere = 10;
@Output()
openProfile = new EventEmitter();
@@ -61,11 +66,17 @@ export class MessagesComponent implements OnInit {
message: Info;
}>();
+ messages: Info[];
+
EventType = EventType;
CONST = CONST;
profileImageRoot: string;
moment = moment;
+ firstEventSeq = 0;
+ lastEventSeq = 0;
+ existReadHere = false;
+
constructor(private logger: NGXLogger, private datePipe: DatePipe) {}
ngOnInit() {
@@ -165,6 +176,31 @@ export class MessagesComponent implements OnInit {
return false;
}
+ getReadHere(messageIndex: number): boolean {
+ if (
+ !!this.roomInfo &&
+ !!this.roomInfo.lastReadEventSeq &&
+ this.roomInfo.lastReadEventSeq > 0 &&
+ this.lastEventSeq - this.roomInfo.lastReadEventSeq > 5
+ ) {
+ if (
+ this.roomInfo.roomType === RoomType.Single ||
+ this.roomInfo.roomType === RoomType.Multi
+ ) {
+ if (!this.roomInfo.isTimeRoom) {
+ if (
+ this.messages[messageIndex].seq ===
+ this.roomInfo.lastReadEventSeq + 1
+ ) {
+ this.existReadHere = true;
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
onClickOpenProfile(event: MouseEvent, userInfo: UserInfo) {
event.preventDefault();
event.stopPropagation();
diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts b/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts
index 8fb93cc5..6df9d258 100644
--- a/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts
+++ b/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts
@@ -23,6 +23,7 @@ import { InformationComponent as MBInformationComponent } from './components/mes
import { MassTranslationComponent as MBMassTranslationComponent } from './components/message-box/mass-translation.component';
import { MassComponent as MBMassComponent } from './components/message-box/mass.component';
import { NoticeComponent as MBNoticeComponent } from './components/message-box/notice.component';
+import { ReadHereComponent as MBReadHereComponent } from './components/message-box/read-here.component';
import { RecallComponent as MBRecallComponent } from './components/message-box/recall.component';
import { ScheduleComponent as MBScheduleComponent } from './components/message-box/schedule.component';
import { StickerComponent as MBStickerComponent } from './components/message-box/sticker.component';
@@ -43,6 +44,7 @@ const COMPONENTS = [
MBMassTranslationComponent,
MBMassComponent,
MBNoticeComponent,
+ MBReadHereComponent,
MBRecallComponent,
MBScheduleComponent,
MBStickerComponent,