Skip to content

Commit e71ff55

Browse files
author
Jeff Yanta
committed
messaging: define typing states
1 parent 1465cf3 commit e71ff55

File tree

8 files changed

+428
-280
lines changed

8 files changed

+428
-280
lines changed

generated/go/messaging/v1/messaging_service.pb.go

Lines changed: 105 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/go/messaging/v1/messaging_service.pb.validate.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/go/messaging/v1/model.pb.go

Lines changed: 258 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/go/messaging/v1/model.pb.validate.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/protobuf-es/messaging/v1/messaging_service_pb.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
77
import { Message, proto3 } from "@bufbuild/protobuf";
88
import { Auth, ChatId, ClientPong, IntentId, QueryOptions, ServerPing, UserId } from "../../common/v1/common_pb";
9-
import { Content, Message as Message$1, MessageBatch, MessageId, MessageIdBatch, Pointer } from "./model_pb";
9+
import { Content, Message as Message$1, MessageBatch, MessageId, MessageIdBatch, Pointer, TypingState } from "./model_pb";
1010

1111
/**
1212
* @generated from message flipchat.messaging.v1.StreamMessagesRequest
@@ -830,10 +830,17 @@ export class NotifyIsTypingRequest extends Message<NotifyIsTypingRequest> {
830830
chatId?: ChatId;
831831

832832
/**
833+
* Deprecated: Use typing_state instead
834+
*
833835
* @generated from field: bool is_typing = 2;
834836
*/
835837
isTyping = false;
836838

839+
/**
840+
* @generated from field: flipchat.messaging.v1.TypingState typing_state = 4;
841+
*/
842+
typingState = TypingState.STARTED_TYPING;
843+
837844
/**
838845
* @generated from field: flipchat.common.v1.Auth auth = 3;
839846
*/
@@ -849,6 +856,7 @@ export class NotifyIsTypingRequest extends Message<NotifyIsTypingRequest> {
849856
static readonly fields: FieldList = proto3.util.newFieldList(() => [
850857
{ no: 1, name: "chat_id", kind: "message", T: ChatId },
851858
{ no: 2, name: "is_typing", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
859+
{ no: 4, name: "typing_state", kind: "enum", T: proto3.getEnumType(TypingState) },
852860
{ no: 3, name: "auth", kind: "message", T: Auth },
853861
]);
854862

generated/protobuf-es/messaging/v1/model_pb.ts

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM
77
import { Message as Message$1, proto3, Timestamp } from "@bufbuild/protobuf";
88
import { PaymentAmount, UserId } from "../../common/v1/common_pb";
99

10+
/**
11+
* @generated from enum flipchat.messaging.v1.TypingState
12+
*/
13+
export enum TypingState {
14+
/**
15+
* @generated from enum value: STARTED_TYPING = 0;
16+
*/
17+
STARTED_TYPING = 0,
18+
19+
/**
20+
* @generated from enum value: STILL_TYPING = 1;
21+
*/
22+
STILL_TYPING = 1,
23+
24+
/**
25+
* @generated from enum value: STOPPED_TYPING = 2;
26+
*/
27+
STOPPED_TYPING = 2,
28+
29+
/**
30+
* @generated from enum value: TYPING_TIMED_OUT = 3;
31+
*/
32+
TYPING_TIMED_OUT = 3,
33+
}
34+
// Retrieve enum metadata with: proto3.getEnumType(TypingState)
35+
proto3.util.setEnumType(TypingState, "flipchat.messaging.v1.TypingState", [
36+
{ no: 0, name: "STARTED_TYPING" },
37+
{ no: 1, name: "STILL_TYPING" },
38+
{ no: 2, name: "STOPPED_TYPING" },
39+
{ no: 3, name: "TYPING_TIMED_OUT" },
40+
]);
41+
1042
/**
1143
* @generated from message flipchat.messaging.v1.MessageId
1244
*/
@@ -294,13 +326,17 @@ export class IsTyping extends Message$1<IsTyping> {
294326
userId?: UserId;
295327

296328
/**
297-
* is_typing indicates whether or not the user is typing.
298-
* If false, the user has explicitly stopped typing.
329+
* Deprecated: Use typing_state instead
299330
*
300331
* @generated from field: bool is_typing = 2;
301332
*/
302333
isTyping = false;
303334

335+
/**
336+
* @generated from field: flipchat.messaging.v1.TypingState typing_state = 3;
337+
*/
338+
typingState = TypingState.STARTED_TYPING;
339+
304340
constructor(data?: PartialMessage<IsTyping>) {
305341
super();
306342
proto3.util.initPartial(data, this);
@@ -311,6 +347,7 @@ export class IsTyping extends Message$1<IsTyping> {
311347
static readonly fields: FieldList = proto3.util.newFieldList(() => [
312348
{ no: 1, name: "user_id", kind: "message", T: UserId },
313349
{ no: 2, name: "is_typing", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
350+
{ no: 3, name: "typing_state", kind: "enum", T: proto3.getEnumType(TypingState) },
314351
]);
315352

316353
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): IsTyping {

proto/messaging/v1/messaging_service.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,11 @@ message AdvancePointerResponse {
187187
message NotifyIsTypingRequest {
188188
common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true];
189189

190+
// Deprecated: Use typing_state instead
190191
bool is_typing = 2;
191192

193+
TypingState typing_state = 4;
194+
192195
common.v1.Auth auth = 3 [(validate.rules).message.required = true];
193196
}
194197

proto/messaging/v1/model.proto

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,17 @@ message Pointer {
8181
message IsTyping {
8282
common.v1.UserId user_id = 1 [(validate.rules).message.required = true];
8383

84-
// is_typing indicates whether or not the user is typing.
85-
// If false, the user has explicitly stopped typing.
84+
// Deprecated: Use typing_state instead
8685
bool is_typing = 2;
86+
87+
TypingState typing_state = 3;
88+
}
89+
90+
enum TypingState {
91+
STARTED_TYPING = 0;
92+
STILL_TYPING = 1;
93+
STOPPED_TYPING = 2;
94+
TYPING_TIMED_OUT = 3;
8795
}
8896

8997
// Content for a chat message

0 commit comments

Comments
 (0)