Merge branch 'refs/heads/feature-im-gitea'
This commit is contained in:
commit
4bf18347ce
|
|
@ -274,6 +274,6 @@ func FindGroupUsers(group_id int) []GroupUser {
|
||||||
|
|
||||||
func FindGroupByNameLike(groupName string) []Group {
|
func FindGroupByNameLike(groupName string) []Group {
|
||||||
var groups []Group
|
var groups []Group
|
||||||
DB.Debug().Where("group_name like ?", "%"+groupName+"%").Find(&groups)
|
DB.Debug().Where("group_name like ?", "%"+groupName+"%").Limit(20).Find(&groups)
|
||||||
return groups
|
return groups
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,12 @@ func CreateGeneralMessageService(from_id, to_id, msg_type, group_id int, content
|
||||||
err, id = dao.CreateGeneralMessage(from_id, to_id, msg_type, 0, group_id, content)
|
err, id = dao.CreateGeneralMessage(from_id, to_id, msg_type, 0, group_id, content)
|
||||||
case proto.MSG_TYPE_GROUP_ADD:
|
case proto.MSG_TYPE_GROUP_ADD:
|
||||||
//加入群聊请求
|
//加入群聊请求
|
||||||
|
//判断是否在群里
|
||||||
|
groupUser := dao.FindGroupUser(from_id, group_id)
|
||||||
|
if len(groupUser) > 0 {
|
||||||
|
return errors.New("已在群里"), 0
|
||||||
|
}
|
||||||
|
err, id = dao.CreateGeneralMessage(from_id, to_id, msg_type, 0, group_id, content)
|
||||||
|
|
||||||
case proto.MSG_TYPE_GROUP_INVI:
|
case proto.MSG_TYPE_GROUP_INVI:
|
||||||
//邀请加群,直接加入
|
//邀请加群,直接加入
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue