Loading console/ui/src/app/channels/chatMessages.component.html +2 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ <div class="btn-group page-btns" role="group" aria-label="Basic example"> <button type="button" class="btn btn-outline-secondary" (click)="search(0)" [disabled]="messages.length === 0"> <img src="/static/svg/page-first.svg" alt="" width="20" height=""></button> <button type="button" class="btn btn-outline-secondary" (click)="search(-1)" [disabled]="prevCursor === '' || prevCursor === null"><img src="/static/svg/page-prev.svg" alt="" width="20" height=""></button> <button type="button" class="btn btn-outline-secondary" (click)="search(1)" [disabled]="nextCursor === '' || nextCursor === null"><img src="/static/svg/page-next.svg" alt="" width="20" height=""></button> </div> Loading console/ui/src/app/channels/chatMessages.component.ts +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ export class ChatListComponent implements OnInit { public readonly systemUserId = '00000000-0000-0000-0000-000000000000'; public error = ''; public messages: Array<ApiChannelMessage> = []; public prevCursor = ''; public nextCursor = ''; public searchForm1: FormGroup; public searchForm2: FormGroup; Loading Loading @@ -88,6 +89,7 @@ export class ChatListComponent implements OnInit { this.messages.length = 0; this.messages.push(...d[0].messages); this.nextCursor = d[0].next_cursor; this.prevCursor = d[0].prev_cursor; } if (d.error) { this.error = d.error; Loading Loading @@ -119,6 +121,9 @@ export class ChatListComponent implements OnInit { case 1: cursor = this.nextCursor; break; case -1: cursor = this.prevCursor; break; } this.updateMessages(this.type, this.f1.label.value, this.f2.group_id.value, this.f3.user_id_one.value, this.f3.user_id_two.value, cursor) Loading Loading @@ -148,6 +153,7 @@ export class ChatListComponent implements OnInit { this.messages.length = 0; this.messages.push(...d.messages); this.nextCursor = d.next_cursor; this.prevCursor = d.prev_cursor; let params: Params; switch(this.type) { Loading server/console_channel.go +2 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ func (s *ConsoleServer) ListChannelMessages(ctx context.Context, in *console.Lis return nil, status.Error(codes.InvalidArgument, "Cursor is invalid or expired.") } messageList, err := ChannelMessagesList(ctx, s.logger, s.db, uuid.Nil, *stream, channelId, limit, false, cursor, nil) haystack := time.Unix(in.HaystackSec, 0).UTC() messageList, err := ChannelMessagesList(ctx, s.logger, s.db, uuid.Nil, *stream, channelId, limit, in.Forward, cursor, &haystack) if err == runtime.ErrChannelCursorInvalid { return nil, status.Error(codes.InvalidArgument, "Cursor is invalid or expired.") } else if err != nil { Loading Loading
console/ui/src/app/channels/chatMessages.component.html +2 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ <div class="btn-group page-btns" role="group" aria-label="Basic example"> <button type="button" class="btn btn-outline-secondary" (click)="search(0)" [disabled]="messages.length === 0"> <img src="/static/svg/page-first.svg" alt="" width="20" height=""></button> <button type="button" class="btn btn-outline-secondary" (click)="search(-1)" [disabled]="prevCursor === '' || prevCursor === null"><img src="/static/svg/page-prev.svg" alt="" width="20" height=""></button> <button type="button" class="btn btn-outline-secondary" (click)="search(1)" [disabled]="nextCursor === '' || nextCursor === null"><img src="/static/svg/page-next.svg" alt="" width="20" height=""></button> </div> Loading
console/ui/src/app/channels/chatMessages.component.ts +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ export class ChatListComponent implements OnInit { public readonly systemUserId = '00000000-0000-0000-0000-000000000000'; public error = ''; public messages: Array<ApiChannelMessage> = []; public prevCursor = ''; public nextCursor = ''; public searchForm1: FormGroup; public searchForm2: FormGroup; Loading Loading @@ -88,6 +89,7 @@ export class ChatListComponent implements OnInit { this.messages.length = 0; this.messages.push(...d[0].messages); this.nextCursor = d[0].next_cursor; this.prevCursor = d[0].prev_cursor; } if (d.error) { this.error = d.error; Loading Loading @@ -119,6 +121,9 @@ export class ChatListComponent implements OnInit { case 1: cursor = this.nextCursor; break; case -1: cursor = this.prevCursor; break; } this.updateMessages(this.type, this.f1.label.value, this.f2.group_id.value, this.f3.user_id_one.value, this.f3.user_id_two.value, cursor) Loading Loading @@ -148,6 +153,7 @@ export class ChatListComponent implements OnInit { this.messages.length = 0; this.messages.push(...d.messages); this.nextCursor = d.next_cursor; this.prevCursor = d.prev_cursor; let params: Params; switch(this.type) { Loading
server/console_channel.go +2 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ func (s *ConsoleServer) ListChannelMessages(ctx context.Context, in *console.Lis return nil, status.Error(codes.InvalidArgument, "Cursor is invalid or expired.") } messageList, err := ChannelMessagesList(ctx, s.logger, s.db, uuid.Nil, *stream, channelId, limit, false, cursor, nil) haystack := time.Unix(in.HaystackSec, 0).UTC() messageList, err := ChannelMessagesList(ctx, s.logger, s.db, uuid.Nil, *stream, channelId, limit, in.Forward, cursor, &haystack) if err == runtime.ErrChannelCursorInvalid { return nil, status.Error(codes.InvalidArgument, "Cursor is invalid or expired.") } else if err != nil { Loading