Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@ called out explicitly even when nothing else did.
release notes, so a version with no entry here does not release. Write the entry in the same PR that
syncs the contract, while the diff is still in front of you.

## 0.15.0

Synced to [`flipcash2-protobuf-api@993127b5`](https://github.com/code-payments/flipcash2-protobuf-api/commit/993127b50e42046ee2f290f122b05625774a0661),
picking up [#130](https://github.com/code-payments/flipcash2-protobuf-api/pull/130) and
[#131](https://github.com/code-payments/flipcash2-protobuf-api/pull/131). Only `chat.v1` moved.

### Added

- `Chat.GetMentionSuggestions`, a new RPC: a ranked pool of people to suggest after an @ in a group
chat, most relevant first. Today that's the group's most recent senders, including people who
have since left. It is not paged and not complete; the server returns up to 200, and the client
filters the pool locally as the user types. A DM is `DENIED`.
- `GetMentionSuggestionsRequest` (`chat_id`, `auth`) and `GetMentionSuggestionsResponse`
(`result`: `OK`, `DENIED`, `NOT_FOUND`; repeated `suggestions`).
- `chat.v1.MentionSuggestion`: a `UserProfile` with `user_id` and `username` always set, and
`last_sent_at`, unset for someone suggested for another reason. It is not a `Member`.

### Upgrading

Nothing existing changed: no renames, and no field or enum renumbering. The server already drops
the caller, users the caller blocked, and users without a username from the pool, so a client
doesn't need its own username filter on these results.

## 0.14.1

Synced to [`flipcash2-protobuf-api@d082b0a3`](https://github.com/code-payments/flipcash2-protobuf-api/commit/d082b0a3dd268f884f75402ccd355b6548612221),
Expand Down
4 changes: 2 additions & 2 deletions Sources/Flipcash2ClientProtocol/ContractInfo.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Generated by scripts/generate-swift.sh. Do not edit.

public enum Flipcash2ContractInfo {
public static let version = "0.14.0-dev"
public static let protoCommit = "d082b0a3dd268f884f75402ccd355b6548612221"
public static let version = "0.15.0-dev"
public static let protoCommit = "993127b50e42046ee2f290f122b05625774a0661"

public static var isLocal: Bool { protoCommit == localSentinel }

Expand Down
200 changes: 200 additions & 0 deletions Sources/Flipcash2ClientProtocol/chat_v1_chat_service.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public enum Flipcash_Chat_V1_Chat {
method: "GetRoster"
)
}
/// Namespace for "GetMentionSuggestions" metadata.
public enum GetMentionSuggestions {
/// Request type for "GetMentionSuggestions".
public typealias Input = Flipcash_Chat_V1_GetMentionSuggestionsRequest
/// Response type for "GetMentionSuggestions".
public typealias Output = Flipcash_Chat_V1_GetMentionSuggestionsResponse
/// Descriptor for "GetMentionSuggestions".
public static let descriptor = GRPCCore.MethodDescriptor(
service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"),
method: "GetMentionSuggestions"
)
}
/// Namespace for "StartChat" metadata.
public enum StartChat {
/// Request type for "StartChat".
Expand Down Expand Up @@ -146,6 +158,7 @@ public enum Flipcash_Chat_V1_Chat {
GetDmChatFeed.descriptor,
GetGroupChatFeed.descriptor,
GetRoster.descriptor,
GetMentionSuggestions.descriptor,
StartChat.descriptor,
JoinChat.descriptor,
LeaveChat.descriptor,
Expand Down Expand Up @@ -337,6 +350,46 @@ extension Flipcash_Chat_V1_Chat {
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Flipcash_Chat_V1_GetRosterResponse>) async throws -> Result
) async throws -> Result where Result: Sendable

/// Call the "GetMentionSuggestions" method.
///
/// > Source IDL Documentation:
/// >
/// > GetMentionSuggestions returns people the caller may want to @mention in
/// > a group chat, ranked by the server, most relevant first. Today that is
/// > the group's most recent senders, most recent first, including people
/// > who have since left the group.
/// >
/// > The response is a ranked pool of suggestions, not the set of people who
/// > may be mentioned, and it is neither complete nor paged. The server
/// > decides how many to return, up to 200; the client filters the whole
/// > pool locally as the user types, however few rows it displays, and keeps
/// > it fresh from the event stream by moving the sender of each new message
/// > to the front. It fetches the pool once per composing session. The
/// > ranking and the pool's size may change without notice; clients must
/// > not depend on either beyond the order given.
/// >
/// > The caller, users the caller has blocked, and users without a username
/// > are never suggested. A user who has blocked the caller may still be.
/// >
/// > Requires that the caller may speak in the chat. A DM is DENIED.
///
/// - Parameters:
/// - request: A request containing a single `Flipcash_Chat_V1_GetMentionSuggestionsRequest` message.
/// - serializer: A serializer for `Flipcash_Chat_V1_GetMentionSuggestionsRequest` messages.
/// - deserializer: A deserializer for `Flipcash_Chat_V1_GetMentionSuggestionsResponse` messages.
/// - options: Options to apply to this RPC.
/// - handleResponse: A closure which handles the response, the result of which is
/// returned to the caller. Returning from the closure will cancel the RPC if it
/// hasn't already finished.
/// - Returns: The result of `handleResponse`.
func getMentionSuggestions<Result>(
request: GRPCCore.ClientRequest<Flipcash_Chat_V1_GetMentionSuggestionsRequest>,
serializer: some GRPCCore.MessageSerializer<Flipcash_Chat_V1_GetMentionSuggestionsRequest>,
deserializer: some GRPCCore.MessageDeserializer<Flipcash_Chat_V1_GetMentionSuggestionsResponse>,
options: GRPCCore.CallOptions,
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Flipcash_Chat_V1_GetMentionSuggestionsResponse>) async throws -> Result
) async throws -> Result where Result: Sendable

/// Call the "StartChat" method.
///
/// > Source IDL Documentation:
Expand Down Expand Up @@ -728,6 +781,57 @@ extension Flipcash_Chat_V1_Chat {
)
}

/// Call the "GetMentionSuggestions" method.
///
/// > Source IDL Documentation:
/// >
/// > GetMentionSuggestions returns people the caller may want to @mention in
/// > a group chat, ranked by the server, most relevant first. Today that is
/// > the group's most recent senders, most recent first, including people
/// > who have since left the group.
/// >
/// > The response is a ranked pool of suggestions, not the set of people who
/// > may be mentioned, and it is neither complete nor paged. The server
/// > decides how many to return, up to 200; the client filters the whole
/// > pool locally as the user types, however few rows it displays, and keeps
/// > it fresh from the event stream by moving the sender of each new message
/// > to the front. It fetches the pool once per composing session. The
/// > ranking and the pool's size may change without notice; clients must
/// > not depend on either beyond the order given.
/// >
/// > The caller, users the caller has blocked, and users without a username
/// > are never suggested. A user who has blocked the caller may still be.
/// >
/// > Requires that the caller may speak in the chat. A DM is DENIED.
///
/// - Parameters:
/// - request: A request containing a single `Flipcash_Chat_V1_GetMentionSuggestionsRequest` message.
/// - serializer: A serializer for `Flipcash_Chat_V1_GetMentionSuggestionsRequest` messages.
/// - deserializer: A deserializer for `Flipcash_Chat_V1_GetMentionSuggestionsResponse` messages.
/// - options: Options to apply to this RPC.
/// - handleResponse: A closure which handles the response, the result of which is
/// returned to the caller. Returning from the closure will cancel the RPC if it
/// hasn't already finished.
/// - Returns: The result of `handleResponse`.
public func getMentionSuggestions<Result>(
request: GRPCCore.ClientRequest<Flipcash_Chat_V1_GetMentionSuggestionsRequest>,
serializer: some GRPCCore.MessageSerializer<Flipcash_Chat_V1_GetMentionSuggestionsRequest>,
deserializer: some GRPCCore.MessageDeserializer<Flipcash_Chat_V1_GetMentionSuggestionsResponse>,
options: GRPCCore.CallOptions = .defaults,
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Flipcash_Chat_V1_GetMentionSuggestionsResponse>) async throws -> Result = { response in
try response.message
}
) async throws -> Result where Result: Sendable {
try await self.client.unary(
request: request,
descriptor: Flipcash_Chat_V1_Chat.Method.GetMentionSuggestions.descriptor,
serializer: serializer,
deserializer: deserializer,
options: options,
onResponse: handleResponse
)
}

/// Call the "StartChat" method.
///
/// > Source IDL Documentation:
Expand Down Expand Up @@ -1153,6 +1257,52 @@ extension Flipcash_Chat_V1_Chat.ClientProtocol {
)
}

/// Call the "GetMentionSuggestions" method.
///
/// > Source IDL Documentation:
/// >
/// > GetMentionSuggestions returns people the caller may want to @mention in
/// > a group chat, ranked by the server, most relevant first. Today that is
/// > the group's most recent senders, most recent first, including people
/// > who have since left the group.
/// >
/// > The response is a ranked pool of suggestions, not the set of people who
/// > may be mentioned, and it is neither complete nor paged. The server
/// > decides how many to return, up to 200; the client filters the whole
/// > pool locally as the user types, however few rows it displays, and keeps
/// > it fresh from the event stream by moving the sender of each new message
/// > to the front. It fetches the pool once per composing session. The
/// > ranking and the pool's size may change without notice; clients must
/// > not depend on either beyond the order given.
/// >
/// > The caller, users the caller has blocked, and users without a username
/// > are never suggested. A user who has blocked the caller may still be.
/// >
/// > Requires that the caller may speak in the chat. A DM is DENIED.
///
/// - Parameters:
/// - request: A request containing a single `Flipcash_Chat_V1_GetMentionSuggestionsRequest` message.
/// - options: Options to apply to this RPC.
/// - handleResponse: A closure which handles the response, the result of which is
/// returned to the caller. Returning from the closure will cancel the RPC if it
/// hasn't already finished.
/// - Returns: The result of `handleResponse`.
public func getMentionSuggestions<Result>(
request: GRPCCore.ClientRequest<Flipcash_Chat_V1_GetMentionSuggestionsRequest>,
options: GRPCCore.CallOptions = .defaults,
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Flipcash_Chat_V1_GetMentionSuggestionsResponse>) async throws -> Result = { response in
try response.message
}
) async throws -> Result where Result: Sendable {
try await self.getMentionSuggestions(
request: request,
serializer: GRPCProtobuf.ProtobufSerializer<Flipcash_Chat_V1_GetMentionSuggestionsRequest>(),
deserializer: GRPCProtobuf.ProtobufDeserializer<Flipcash_Chat_V1_GetMentionSuggestionsResponse>(),
options: options,
onResponse: handleResponse
)
}

/// Call the "StartChat" method.
///
/// > Source IDL Documentation:
Expand Down Expand Up @@ -1563,6 +1713,56 @@ extension Flipcash_Chat_V1_Chat.ClientProtocol {
)
}

/// Call the "GetMentionSuggestions" method.
///
/// > Source IDL Documentation:
/// >
/// > GetMentionSuggestions returns people the caller may want to @mention in
/// > a group chat, ranked by the server, most relevant first. Today that is
/// > the group's most recent senders, most recent first, including people
/// > who have since left the group.
/// >
/// > The response is a ranked pool of suggestions, not the set of people who
/// > may be mentioned, and it is neither complete nor paged. The server
/// > decides how many to return, up to 200; the client filters the whole
/// > pool locally as the user types, however few rows it displays, and keeps
/// > it fresh from the event stream by moving the sender of each new message
/// > to the front. It fetches the pool once per composing session. The
/// > ranking and the pool's size may change without notice; clients must
/// > not depend on either beyond the order given.
/// >
/// > The caller, users the caller has blocked, and users without a username
/// > are never suggested. A user who has blocked the caller may still be.
/// >
/// > Requires that the caller may speak in the chat. A DM is DENIED.
///
/// - Parameters:
/// - message: request message to send.
/// - metadata: Additional metadata to send, defaults to empty.
/// - options: Options to apply to this RPC, defaults to `.defaults`.
/// - handleResponse: A closure which handles the response, the result of which is
/// returned to the caller. Returning from the closure will cancel the RPC if it
/// hasn't already finished.
/// - Returns: The result of `handleResponse`.
public func getMentionSuggestions<Result>(
_ message: Flipcash_Chat_V1_GetMentionSuggestionsRequest,
metadata: GRPCCore.Metadata = [:],
options: GRPCCore.CallOptions = .defaults,
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Flipcash_Chat_V1_GetMentionSuggestionsResponse>) async throws -> Result = { response in
try response.message
}
) async throws -> Result where Result: Sendable {
let request = GRPCCore.ClientRequest<Flipcash_Chat_V1_GetMentionSuggestionsRequest>(
message: message,
metadata: metadata
)
return try await self.getMentionSuggestions(
request: request,
options: options,
onResponse: handleResponse
)
}

/// Call the "StartChat" method.
///
/// > Source IDL Documentation:
Expand Down
Loading
Loading