feat: Add light mode and dark mode.(#89) (#558)

* feat: Add light mode and dark mode.(#89)

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: make file code len

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: fix scripts support win

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: make build issue

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: golint and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add scripts sudo limits of authority

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: docker images fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* fix: docker images fix

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong
2023-07-14 16:17:59 +08:00
committed by GitHub
parent 70d8ae4c19
commit b85c5ad84e
113 changed files with 1158 additions and 926 deletions
+3 -3
View File
@@ -95,7 +95,7 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
if err == nil {
apns.Payload.Aps.Badge = &unreadCountSum
} else {
//log.Error(operationID, "IncrUserBadgeUnreadCountSum redis err", err.Error(), uid)
// log.Error(operationID, "IncrUserBadgeUnreadCountSum redis err", err.Error(), uid)
Fail++
continue
}
@@ -107,7 +107,7 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
zero := 1
apns.Payload.Aps.Badge = &zero
} else {
//log.Error(operationID, "GetUserBadgeUnreadCountSum redis err", err.Error(), uid)
// log.Error(operationID, "GetUserBadgeUnreadCountSum redis err", err.Error(), uid)
Fail++
continue
}
@@ -127,7 +127,7 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
response, err := f.fcmMsgCli.SendAll(ctx, messages)
if err != nil {
Fail = Fail + messageCount
//log.Info(operationID, "some token push err", err.Error(), messageCount)
// log.Info(operationID, "some token push err", err.Error(), messageCount)
} else {
Success = Success + response.SuccessCount
Fail = Fail + response.FailureCount
+1 -1
View File
@@ -145,7 +145,7 @@ func newPushReq(title, content string) PushReq {
}
func newBatchPushReq(userIDs []string, taskID string) PushReq {
var IsAsync = true
IsAsync := true
return PushReq{Audience: &Audience{Alias: userIDs}, IsAsync: &IsAsync, TaskID: &taskID}
}
+5 -6
View File
@@ -15,17 +15,16 @@
package getui
import (
"sync"
"github.com/go-redis/redis"
"context"
"crypto/sha256"
"encoding/hex"
"errors"
"strconv"
"sync"
"time"
"github.com/go-redis/redis"
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
@@ -49,7 +48,7 @@ const (
taskURL = "/push/list/message"
batchPushURL = "/push/list/alias"
// codes
// codes.
tokenExpireCode = 10001
tokenExpireTime = 60 * 60 * 23
taskIDTTL = 1000 * 60 * 60 * 24
@@ -142,7 +141,7 @@ func (g *Client) GetTaskID(ctx context.Context, token string, pushReq PushReq) (
return respTask.TaskID, nil
}
// max num is 999
// max num is 999.
func (g *Client) batchPush(ctx context.Context, token string, userIDs []string, pushReq PushReq) error {
taskID, err := g.GetTaskID(ctx, token, pushReq)
if err != nil {
@@ -66,6 +66,7 @@ func (p *Platform) Set(os string) error {
return nil
}
func (p *Platform) SetPlatform(platform string) error {
switch platform {
case constant.AndroidPlatformStr:
@@ -75,8 +76,8 @@ func (p *Platform) SetPlatform(platform string) error {
default:
return errors.New("platform err")
}
}
func (p *Platform) SetIOS() error {
return p.Set(IOS)
}
@@ -37,6 +37,7 @@ func (p *PushObj) SetNotification(no *Notification) {
func (p *PushObj) SetMessage(m *Message) {
p.Message = m
}
func (p *PushObj) SetOptions(o *Options) {
p.Options = o
}