Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #55 from signal-golang/json_marshall_error
Browse files Browse the repository at this point in the history
Fix receiving messages on 32bit systems
  • Loading branch information
nanu-c authored Jan 28, 2022
2 parents 9ce24f5 + 5692f19 commit 042b4bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crayfish/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ type Sender struct {
}
type PhoneNumber struct {
Code PhoneNumberCode `json:"code"`
National PhoneNumberNational `json:"national"`
National PhoneNumberNational `json:"national,string,omitempty"`
}
type PhoneNumberCode struct {
Value int `json:"value"`
Value uint64 `json:"value"`
Source string `json:"source"`
}
type PhoneNumberNational struct {
Value int `json:"value"`
Zeros int `json:"zeros"`
Value uint64 `json:"value"`
Zeros int `json:"zeros"`
}

func Run() {
Expand Down
2 changes: 1 addition & 1 deletion textsecure.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ func handleReceivedMessage(env *signalservice.Envelope) error {
return err
}
env.Content = content
phoneNumber := "+" + strconv.Itoa(data.Sender.PhoneNumber.Code.Value) + strconv.Itoa(data.Sender.PhoneNumber.National.Value)
phoneNumber := "+" + strconv.FormatUint(data.Sender.PhoneNumber.Code.Value, 10) + strconv.FormatUint(data.Sender.PhoneNumber.National.Value, 10)
log.Println("[textsecure] handleReceivedMessage:", phoneNumber, data.Sender.UUID)
err = handleMessage(phoneNumber, data.Sender.UUID, uint64(data.Timestamp), content)
if err != nil {
Expand Down

0 comments on commit 042b4bf

Please sign in to comment.