Browse Source

Attempt to make the getID func more 32-bit friendly

main
Sam 5 years ago
parent
commit
e51bcca5ba
  1. 4
      chat.go

4
chat.go

@ -13,7 +13,7 @@ import (
// Returns a string representation of a message id suitable for use in a // Returns a string representation of a message id suitable for use in a
// pagination struct // pagination struct
func getID(id int) string { func getID(id uint) string {
var b []byte var b []byte
switch { switch {
case id < 128: case id < 128:
@ -289,7 +289,7 @@ func (c Chat) ReadMessage(messageID int) (*ChatAPI, error) {
m.Params.Options.Channel = &c.Channel m.Params.Options.Channel = &c.Channel
m.Params.Options.Pagination.Num = 1 m.Params.Options.Pagination.Num = 1
m.Params.Options.Pagination.Previous = getID(messageID - 1) m.Params.Options.Pagination.Previous = getID(uint(messageID - 1))
r, err := chatAPIOut(c.keybase, m) r, err := chatAPIOut(c.keybase, m)
if err != nil { if err != nil {

Loading…
Cancel
Save