Commit 3e42efd4 authored by Fernando Takagi's avatar Fernando Takagi
Browse files

Add chat console params: forward and haystack

parent 65718af7
Loading
Loading
Loading
Loading
+756 −735

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -727,6 +727,10 @@ message ListChannelMessagesRequest {
  string user_id_two = 5;
  // Cursor to start from
  string cursor = 6;
  // Whether to list messages from oldest to newest, or newest to oldest.
  bool forward = 7;
  // Timestamp to list messages around, if no cursor is provided
  int64 haystack_sec = 8;
}

// List (and optionally filter) groups.
+15 −0
Original line number Diff line number Diff line
@@ -1180,6 +1180,21 @@
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "forward",
            "description": "Whether to list messages from oldest to newest, or newest to oldest.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "haystack_sec",
            "description": "Timestamp to list messages around, if no cursor is provided.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
+7 −1
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ export class ConsoleService {
  }

  /** List channel messages with the selected filter */
  listChannelMessages(auth_token: string, type?: string, label?: string, group_id?: string, user_id_one?: string, user_id_two?: string, cursor?: string): Observable<ApiChannelMessageList> {
  listChannelMessages(auth_token: string, type?: string, label?: string, group_id?: string, user_id_one?: string, user_id_two?: string, cursor?: string, forward?: boolean, haystack_sec?: string): Observable<ApiChannelMessageList> {
		const urlPath = `/v2/console/channel`;
    let params = new HttpParams();
    if (type) {
@@ -1078,6 +1078,12 @@ export class ConsoleService {
    if (cursor) {
      params = params.set('cursor', cursor);
    }
    if (forward || forward === false) {
      params = params.set('forward', String(forward));
    }
    if (haystack_sec) {
      params = params.set('haystack_sec', haystack_sec);
    }
    return this.httpClient.get<ApiChannelMessageList>(this.config.host + urlPath, { params: params, headers: this.getTokenAuthHeaders(auth_token) })
  }