👽 Update attachment reference to string
This commit is contained in:
@ -24,10 +24,10 @@ type Event struct {
|
||||
// Event Payloads
|
||||
|
||||
type EventMessageBody struct {
|
||||
Text string `json:"text,omitempty"`
|
||||
Algorithm string `json:"algorithm,omitempty"`
|
||||
Attachments []uint `json:"attachments,omitempty"`
|
||||
QuoteEvent uint `json:"quote_event,omitempty"`
|
||||
RelatedEvent uint `json:"related_event,omitempty"`
|
||||
RelatedUsers []uint `json:"related_users,omitempty"`
|
||||
Text string `json:"text,omitempty"`
|
||||
Algorithm string `json:"algorithm,omitempty"`
|
||||
Attachments []string `json:"attachments,omitempty"`
|
||||
QuoteEvent uint `json:"quote_event,omitempty"`
|
||||
RelatedEvent uint `json:"related_event,omitempty"`
|
||||
RelatedUsers []uint `json:"related_users,omitempty"`
|
||||
}
|
||||
|
@ -1,23 +0,0 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
"git.solsynth.dev/hydrogen/messaging/pkg/internal/gap"
|
||||
|
||||
"git.solsynth.dev/hydrogen/paperclip/pkg/proto"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
func CheckAttachmentByIDExists(id uint, usage string) bool {
|
||||
pc, err := gap.H.GetServiceGrpcConn(hyper.ServiceTypeAuthProvider)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
_, err = proto.NewAttachmentsClient(pc).CheckAttachmentExists(context.Background(), &proto.AttachmentLookupRequest{
|
||||
Id: lo.ToPtr(uint64(id)),
|
||||
Usage: &usage,
|
||||
})
|
||||
|
||||
return err == nil
|
||||
}
|
Reference in New Issue
Block a user