mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 05:56:00 +08:00
tag and set private tips
This commit is contained in:
@@ -350,6 +350,11 @@ type config struct {
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||
} `yaml:"conversationOptUpdate"`
|
||||
ConversationSetPrivate struct {
|
||||
Conversation PConversation `yaml:"conversation"`
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||
} `yaml:"conversationSetPrivate"`
|
||||
}
|
||||
Demo struct {
|
||||
Port []int `yaml:"openImDemoPort"`
|
||||
|
||||
@@ -56,13 +56,11 @@ const (
|
||||
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
||||
BlackAddedNotification = 1207 //add_black
|
||||
BlackDeletedNotification = 1208 //remove_black
|
||||
ConversationOptChangeNotification = 1300 // change conversation opt
|
||||
|
||||
ConversationOptChangeNotification = 1300 // change conversation opt
|
||||
|
||||
UserNotificationBegin = 1301
|
||||
UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204
|
||||
ConversationNotification = 1307
|
||||
ConversationNotNotification = 1308
|
||||
ConversationDefault = 0
|
||||
UserNotificationEnd = 1399
|
||||
OANotification = 1400
|
||||
|
||||
@@ -87,7 +85,10 @@ const (
|
||||
SignalingNotificationBegin = 1600
|
||||
SignalingNotification = 1601
|
||||
SignalingNotificationEnd = 1699
|
||||
NotificationEnd = 2000
|
||||
|
||||
ConversationPrivateChatNotification = 1701
|
||||
|
||||
NotificationEnd = 2000
|
||||
|
||||
//status
|
||||
MsgNormal = 1
|
||||
|
||||
@@ -470,6 +470,14 @@ func (d *DataBases) CreateTag(userID, tagName string, userList []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *DataBases) GetTagByID(userID, tagID string) (Tag, error) {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
||||
var tag Tag
|
||||
err := c.FindOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}).Decode(&tag)
|
||||
return tag, err
|
||||
}
|
||||
|
||||
func (d *DataBases) DeleteTag(userID, tagID string) error {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
||||
|
||||
Reference in New Issue
Block a user