You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See [1], in particular "Prefer method and function names that make use
sites form grammatical English phrases".
The "omit needless words" guideline is a bit harder to interpret and I
wonder whether, under that guideline, things like `send(withParams
params: SendMessageParams)` should be `with params: SendMessageParams`
but honestly I don't know how understandable that is, especially when
you use implicit `.init()` to create the argument. I think better to err
on the side of caution and being a bit more verbose?
Have renamed:
- Messages:
- history(options: QueryOptions) to history(withOptions options: QueryOptions)
- send(params: SendMessageParams) to send(withParams params: SendMessageParams)
- MessageSubscriptionAsyncSequence:
- getPreviousMessages(params: QueryOptions) to getPreviousMessages(withParams params: QueryOptions)
- MessageReactions:
- send(messageSerial: String, params: SendMessageReactionParams) to send(forMessageWithSerial messageSerial: String, params: SendMessageReactionParams)
- delete(messageSerial: String, params: SendMessageReactionParams) to delete(forMessageWithSerial messageSerial: String, params: SendMessageReactionParams)
- Presence:
- get(params: PresenceParams) to get(withParams params: PresenceParams)
- isUserPresent(clientID: String) to isUserPresent(withClientID clientID: String)
- enter(data: PresenceData) to enter(withData data: PresenceData); ditto for update, leave
- RoomReactions:
- send(params: SendReactionParams) to send(withParams params: SendReactionParams)
- MessageSubscriptionResponse:
- historyBeforeSubscribe(_ params: QueryOptions) to historyBeforeSubscribe(withParams params: QueryOptions)
Have not touched Messages' `update` or `delete` methods yet because
their signature seems completely inconsistent with that of JS; need to
look into it further.
[1] https://www.swift.org/documentation/api-design-guidelines/
Copy file name to clipboardExpand all lines: Sources/AblyChat/DefaultMessages.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -115,15 +115,15 @@ internal final class DefaultMessages: Messages {
115
115
}
116
116
117
117
// (CHA-M6a) A method must be exposed that accepts the standard Ably REST API query parameters. It shall call the "REST API"#rest-fetching-messages and return a PaginatedResult containing messages, which can then be paginated through.
@@ -28,7 +28,7 @@ public protocol MessageReactions: AnyObject, Sendable {
28
28
* - messageSerial: A serial of the message to remove the reaction from.
29
29
* - params: The type of reaction annotation and the specific reaction to remove. The reaction to remove is required for all types except ``MessageReactionType/unique``.
0 commit comments