-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/bb api helper functions #155
Conversation
imessage/bluebubbles/api.go
Outdated
for _, chat := range *response.Data { | ||
resp = append(resp, imessage.ChatIdentifier{ | ||
ChatGUID: fmt.Sprintf("%v", chat.GUID), | ||
ThreadID: fmt.Sprintf("%v", chat.ChatIdentifier), // TODO Is this the right one to use? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thread ID field is for iMessage group IDs, which are usually uuids. Not sure if BlueBubbles exposes them anywhere, but it's fine to just omit the field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, fmt.Sprintf
ing a string to get the same string seems kind of pointless
imessage/bluebubbles/interface.go
Outdated
type ChatQueryResponse struct { | ||
Status int64 `json:"status"` | ||
Message string `json:"message"` | ||
Data *[]Chat `json:"data"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably doesn't need to be a pointer, slices are nillable on their own
imessage/bluebubbles/api.go
Outdated
"lastMessage", | ||
"sms", | ||
}, | ||
Sort: "lastmessage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These would probably be good to extract into constants
Add helper functions to build the URL and make GetChatsWithMessagesAfter work in a very light fashion