owpengram-server/internal/app/channels/service_groupcall.go

26 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package channels
import (
"context"
"telesrv/internal/domain"
)
// SetActiveCall 写入/清除频道行上的活跃群通话关联groupcalls 模块专用)。
func (s *Service) SetActiveCall(ctx context.Context, channelID, callID, callAccessHash int64, notEmpty bool) (domain.Channel, error) {
if s == nil || s.channels == nil || channelID == 0 {
return domain.Channel{}, domain.ErrChannelInvalid
}
return s.channels.SetActiveCall(ctx, channelID, callID, callAccessHash, notEmpty)
}
// AppendCallServiceMessage 生成群通话服务消息started/ended/invite带频道 pts
func (s *Service) AppendCallServiceMessage(ctx context.Context, channelID, senderUserID int64, date int, action domain.ChannelMessageAction) (domain.SendChannelMessageResult, error) {
if s == nil || s.channels == nil {
return domain.SendChannelMessageResult{}, domain.ErrChannelInvalid
}
if err := s.ensureCanSend(ctx, senderUserID); err != nil {
return domain.SendChannelMessageResult{}, err
}
return s.channels.AppendCallServiceMessage(ctx, channelID, senderUserID, date, action)
}