aboutsummaryrefslogtreecommitdiff
path: root/lib/models/id/channel_id.ml
diff options
context:
space:
mode:
authorMatias Goldfeld <[email protected]>2021-01-28 00:50:21 -0500
committerMatias Goldfeld <[email protected]>2021-01-28 00:50:21 -0500
commitb499169e93e9f7bdd0f877a3cdf0247ec495abe1 (patch)
tree52696cb3e1c16a84513fb90fe50c3738ce4539cb /lib/models/id/channel_id.ml
parentMore 32 bit fixes (diff)
downloaddisml-b499169e93e9f7bdd0f877a3cdf0247ec495abe1.tar.xz
disml-b499169e93e9f7bdd0f877a3cdf0247ec495abe1.zip
More Int64 refactors
Diffstat (limited to 'lib/models/id/channel_id.ml')
-rw-r--r--lib/models/id/channel_id.ml15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/models/id/channel_id.ml b/lib/models/id/channel_id.ml
index 1ea7a46..7c62d84 100644
--- a/lib/models/id/channel_id.ml
+++ b/lib/models/id/channel_id.ml
@@ -33,16 +33,13 @@ let delete ch =
let get_message ~id ch =
Http.get_message (get_id ch) id
-let get_messages ?(mode=`Around) ?id ?(limit=50) ch =
+let get_messages ?(mode=`Around) ~id ?(limit=50) ch =
let kind = match mode with
- | `Around -> "around", limit
- | `Before -> "before", limit
- | `After -> "after", limit
+ | `Around -> "around", id
+ | `Before -> "before", id
+ | `After -> "after", id
in
- let id = match id with
- | Some id -> id
- | None -> raise No_message_found in
- Http.get_messages (get_id ch) id kind
+ Http.get_messages (get_id ch) limit kind
let broadcast_typing ch =
Http.broadcast_typing (get_id ch)
@@ -51,5 +48,5 @@ let get_pins ch =
Http.get_pinned_messages (get_id ch)
let bulk_delete msgs ch =
- let msgs = `List (List.map ~f:(fun id -> `Int id) msgs) in
+ let msgs = `List (List.map ~f:(fun id -> `Intlit (Int64.to_string id)) msgs) in
Http.bulk_delete (get_id ch) msgs \ No newline at end of file