Skip to content

Commit

Permalink
feat: constant (#560)
Browse files Browse the repository at this point in the history
* feat: constant

* feat: constant
  • Loading branch information
icey-yu committed Jun 27, 2024
1 parent ab7f441 commit d7a678f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/group/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ func (g *Group) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
return err
}
switch detail.ReceiverAs {
case 0:
case constant.ApplicantReceiver:
return g.SyncAllSelfGroupApplication(ctx)
case 1:
case constant.AdminReceiver:
return g.SyncAdminGroupApplications(ctx, detail.Group.GroupID)
default:
return fmt.Errorf("GroupApplicationAcceptedNotification ReceiverAs unknown %d", detail.ReceiverAs)
Expand Down
6 changes: 3 additions & 3 deletions pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ const UseHashGroupMemberNum = 1000

const (
Uninitialized = -1001
NoNetwork = 1 //有网络->无网络
NetworkAvailable = 2 //无网络->有网络
NetworkVariation = 3 //有网络,但状态有变化
NoNetwork = 1 // Online -> Offline
NetworkAvailable = 2 // Offline -> Online
NetworkVariation = 3 // Online, but status changed
)
7 changes: 7 additions & 0 deletions pkg/constant/group.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package constant

// GroupApplicationReceiver
const (
ApplicantReceiver = iota
AdminReceiver
)

0 comments on commit d7a678f

Please sign in to comment.