group

package
v3.8.3-patch.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2025 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotificationFilterCacheSize = 1024
	NotificationFilterTimeout   = 10 * time.Second
)

Variables

This section is empty.

Functions

func ServerGroupMemberToLocalGroupMember

func ServerGroupMemberToLocalGroupMember(info *sdkws.GroupMemberFullInfo) *model_struct.LocalGroupMember

func ServerGroupRequestToLocalGroupRequest

func ServerGroupRequestToLocalGroupRequest(info *sdkws.GroupRequest) *model_struct.LocalGroupRequest

func ServerGroupRequestToLocalGroupRequestForNotification

func ServerGroupRequestToLocalGroupRequestForNotification(groupInfo *sdkws.GroupInfo, groupRequest *sdkws.GroupRequest) *model_struct.LocalGroupRequest

func ServerGroupToLocalGroup

func ServerGroupToLocalGroup(info *sdkws.GroupInfo) *model_struct.LocalGroup

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(loginUserID string, db db_interface.DataBase,
	conversationCh chan common.Cmd2Value) *Group

func (*Group) AcceptGroupApplication

func (g *Group) AcceptGroupApplication(ctx context.Context, groupID, fromUserID, handleMsg string) error

func (*Group) ChangeGroupMemberMute

func (g *Group) ChangeGroupMemberMute(ctx context.Context, groupID, userID string, mutedSeconds int) error

func (*Group) ChangeGroupMute

func (g *Group) ChangeGroupMute(ctx context.Context, groupID string, isMute bool) (err error)

func (*Group) CreateGroup

func (g *Group) CreateGroup(ctx context.Context, req *group.CreateGroupReq) (*sdkws.GroupInfo, error)

func (*Group) DismissGroup

func (g *Group) DismissGroup(ctx context.Context, groupID string) error

func (*Group) DoNotification

func (g *Group) DoNotification(ctx context.Context, msg *sdkws.MsgData)

func (*Group) FetchGroupOrError added in v3.8.1

func (g *Group) FetchGroupOrError(ctx context.Context, groupID string) (*model_struct.LocalGroup, error)

func (*Group) GetGroupApplicationUnhandledCount

func (g *Group) GetGroupApplicationUnhandledCount(ctx context.Context, req *sdk_params_callback.GetGroupApplicationUnhandledCountReq) (int32, error)

func (*Group) GetGroupMemberList

func (g *Group) GetGroupMemberList(ctx context.Context, groupID string, filter, offset, count int32) ([]*model_struct.LocalGroupMember, error)

func (*Group) GetGroupMemberListByJoinTimeFilter

func (g *Group) GetGroupMemberListByJoinTimeFilter(ctx context.Context, groupID string, offset, count int32, joinTimeBegin, joinTimeEnd int64, userIDs []string) ([]*model_struct.LocalGroupMember, error)

func (*Group) GetGroupMemberNameAndFaceURL added in v3.8.1

func (g *Group) GetGroupMemberNameAndFaceURL(ctx context.Context, groupID string, userIDs []string) (map[string]*model_struct.LocalGroupMember, error)

func (*Group) GetGroupMemberOwnerAndAdmin

func (g *Group) GetGroupMemberOwnerAndAdmin(ctx context.Context, groupID string) ([]*model_struct.LocalGroupMember, error)

func (*Group) GetGroupMembersInfo added in v3.8.1

func (g *Group) GetGroupMembersInfo(ctx context.Context, groupID string, userIDs []string) (map[string]*model_struct.LocalGroupMember, error)

func (*Group) GetGroupMembersInfoFunc added in v3.8.1

func (g *Group) GetGroupMembersInfoFunc(ctx context.Context, groupID string, userIDs []string,
	fetchFunc func(ctx context.Context, missingKeys []string) ([]*model_struct.LocalGroupMember, error),
) (map[string]*model_struct.LocalGroupMember, error)

func (*Group) GetJoinedGroupList

func (g *Group) GetJoinedGroupList(ctx context.Context) ([]*model_struct.LocalGroup, error)

func (*Group) GetJoinedGroupListPage added in v3.8.0

func (g *Group) GetJoinedGroupListPage(ctx context.Context, offset, count int32) ([]*model_struct.LocalGroup, error)

func (*Group) GetServerJoinGroup

func (g *Group) GetServerJoinGroup(ctx context.Context) ([]*sdkws.GroupInfo, error)

func (*Group) GetSpecifiedGroupMembersInfo

func (g *Group) GetSpecifiedGroupMembersInfo(ctx context.Context, groupID string, userIDList []string) ([]*model_struct.LocalGroupMember, error)

func (*Group) GetSpecifiedGroupsInfo

func (g *Group) GetSpecifiedGroupsInfo(ctx context.Context, groupIDs []string) ([]*model_struct.LocalGroup, error)

func (*Group) GetUsersInGroup added in v3.8.0

func (g *Group) GetUsersInGroup(ctx context.Context, groupID string, userIDList []string) ([]string, error)

func (*Group) HandlerGroupApplication

func (g *Group) HandlerGroupApplication(ctx context.Context, req *group.GroupApplicationResponseReq) error

func (*Group) IncrSyncGroupAndMember added in v3.8.0

func (g *Group) IncrSyncGroupAndMember(ctx context.Context, groupIDs ...string) error

func (*Group) IncrSyncJoinGroup added in v3.8.0

func (g *Group) IncrSyncJoinGroup(ctx context.Context) error

func (*Group) IncrSyncJoinGroupMember added in v3.8.0

func (g *Group) IncrSyncJoinGroupMember(ctx context.Context) error

func (*Group) InviteUserToGroup

func (g *Group) InviteUserToGroup(ctx context.Context, groupID, reason string, userIDList []string) error

func (*Group) IsJoinGroup

func (g *Group) IsJoinGroup(ctx context.Context, groupID string) (bool, error)

func (*Group) JoinGroup

func (g *Group) JoinGroup(ctx context.Context, groupID, reqMsg string, joinSource int32, ex string) error

func (*Group) KickGroupMember

func (g *Group) KickGroupMember(ctx context.Context, groupID string, reason string, userIDList []string) error

func (*Group) QuitGroup

func (g *Group) QuitGroup(ctx context.Context, groupID string) error

func (*Group) RefuseGroupApplication

func (g *Group) RefuseGroupApplication(ctx context.Context, groupID, fromUserID, handleMsg string) error

func (*Group) SearchGroupMembers

func (g *Group) SearchGroupMembers(ctx context.Context, searchParam *sdk_params_callback.SearchGroupMembersParam) ([]*model_struct.LocalGroupMember, error)

func (*Group) SearchGroups

func (*Group) SetGroupInfo

func (g *Group) SetGroupInfo(ctx context.Context, groupInfo *group.SetGroupInfoExReq) error

func (*Group) SetGroupListener

func (g *Group) SetGroupListener(listener func() open_im_sdk_callback.OnGroupListener)

func (*Group) SetGroupMemberInfo

func (g *Group) SetGroupMemberInfo(ctx context.Context, groupMemberInfo *group.SetGroupMemberInfo) error

func (*Group) SetListenerForService

func (g *Group) SetListenerForService(listener open_im_sdk_callback.OnListenerForService)

func (*Group) SyncAllJoinedGroupsAndMembers

func (g *Group) SyncAllJoinedGroupsAndMembers(ctx context.Context) error

func (*Group) SyncAllJoinedGroupsAndMembersWithLock

func (g *Group) SyncAllJoinedGroupsAndMembersWithLock(ctx context.Context) error

func (*Group) TransferGroupOwner

func (g *Group) TransferGroupOwner(ctx context.Context, groupID, newOwnerUserID string) error

type NotificationFilter

type NotificationFilter struct {
	// contains filtered or unexported fields
}

NotificationFilter deduplicates events by UUID, ensuring that the same UUID is only processed once within the specified timeout.

func NewNotificationFilter

func NewNotificationFilter(size int, timeout time.Duration) *NotificationFilter

NewNotificationFilter creates a NotificationFilter with the given capacity (size) and timeout duration.

func (*NotificationFilter) ExecuteIfNew

func (f *NotificationFilter) ExecuteIfNew(uuid string, fn func())

ExecuteIfNew calls fn only if the UUID has not been processed within the timeout period. Otherwise, it does nothing.

func (*NotificationFilter) ShouldExecute

func (f *NotificationFilter) ShouldExecute(uuid string) bool

ShouldExecute returns true if the UUID has not been processed within the timeout period. It also records the current time for this UUID. If the UUID was processed less than timeout ago, it returns false.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL