diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 4a0ec98..1f6ae4e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,15 +4,11 @@
-
-
-
+
-
-
-
-
-
+
+
+
@@ -159,8 +155,6 @@
-
-
@@ -184,7 +178,9 @@
-
+
+
+
true
diff --git a/go.mod b/go.mod
index bf5587e..ece4565 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.21.6
toolchain go1.22.1
require (
- git.solsynth.dev/hydrogen/dealer v0.0.0-20240823113302-208da7e90fdb
+ git.solsynth.dev/hydrogen/dealer v0.0.0-20240824155914-68c6a5565468
github.com/go-playground/validator/v10 v10.17.0
github.com/gofiber/fiber/v2 v2.52.4
github.com/golang-jwt/jwt/v5 v5.2.0
diff --git a/go.sum b/go.sum
index adde4e4..6594594 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,7 @@
git.solsynth.dev/hydrogen/dealer v0.0.0-20240823113302-208da7e90fdb h1:dv4uVDMe53eBprW2Q8ocAhZuO+DKWlWyxGiJMiwE62E=
git.solsynth.dev/hydrogen/dealer v0.0.0-20240823113302-208da7e90fdb/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI=
+git.solsynth.dev/hydrogen/dealer v0.0.0-20240824155914-68c6a5565468 h1:DZ1b5WA1FoUE71zyl6OzQ+QbCo4tPJv077ekM1VQ524=
+git.solsynth.dev/hydrogen/dealer v0.0.0-20240824155914-68c6a5565468/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
diff --git a/pkg/internal/grpc/auth.go b/pkg/internal/grpc/auth.go
index cb70b16..90e4afd 100644
--- a/pkg/internal/grpc/auth.go
+++ b/pkg/internal/grpc/auth.go
@@ -36,6 +36,13 @@ func (v *Server) Authenticate(_ context.Context, in *proto.AuthRequest) (*proto.
userinfo.Banner = *user.GetBanner()
}
+ if user.AffiliatedID != nil {
+ userinfo.AffiliatedTo = lo.ToPtr(uint64(*user.AffiliatedID))
+ }
+ if user.AutomatedID != nil {
+ userinfo.AutomatedBy = lo.ToPtr(uint64(*user.AutomatedID))
+ }
+
return &proto.AuthReply{
IsValid: true,
Info: &proto.AuthInfo{
@@ -108,11 +115,20 @@ func (v *Server) ListUserFriends(_ context.Context, in *proto.ListUserRelativeRe
return &proto.ListUserRelativeResponse{
Data: lo.Map(data, func(item models.AccountRelationship, index int) *proto.SimpleUserInfo {
- return &proto.SimpleUserInfo{
+ val := &proto.SimpleUserInfo{
Id: uint64(item.AccountID),
Name: item.Account.Name,
Nick: item.Account.Nick,
}
+
+ if item.Account.AffiliatedID != nil {
+ val.AffiliatedTo = lo.ToPtr(uint64(*item.Account.AffiliatedID))
+ }
+ if item.Account.AutomatedID != nil {
+ val.AutomatedBy = lo.ToPtr(uint64(*item.Account.AutomatedID))
+ }
+
+ return val
}),
}, nil
}
@@ -133,11 +149,20 @@ func (v *Server) ListUserBlocklist(_ context.Context, in *proto.ListUserRelative
return &proto.ListUserRelativeResponse{
Data: lo.Map(data, func(item models.AccountRelationship, index int) *proto.SimpleUserInfo {
- return &proto.SimpleUserInfo{
+ val := &proto.SimpleUserInfo{
Id: uint64(item.AccountID),
Name: item.Account.Name,
Nick: item.Account.Nick,
}
+
+ if item.Account.AffiliatedID != nil {
+ val.AffiliatedTo = lo.ToPtr(uint64(*item.Account.AffiliatedID))
+ }
+ if item.Account.AutomatedID != nil {
+ val.AutomatedBy = lo.ToPtr(uint64(*item.Account.AutomatedID))
+ }
+
+ return val
}),
}, nil
}