owpengram-server/internal/rpc/phone_register.go

58 lines
2.8 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 rpc
import (
"context"
"github.com/gotd/td/tg"
)
// registerPhone 注册通话域 RPC。
//
// 归属约定(跨任务协调,群聊 M0 落地时遵守):本文件是 phone.* 的唯一注册点;
// gotd ServerDispatcher 对同一 RPC 重复 On* 注册是静默 last-wins群聊 stub
// 清单不得覆盖此处已注册的真实现。messages.getDhConfig 属通话域DH 参数下发),
// 注册在这里而非 messages_register.go。
func (r *Router) registerPhone(d *tg.ServerDispatcher) {
d.OnMessagesGetDhConfig(r.onMessagesGetDhConfig)
d.OnPhoneRequestCall(r.onPhoneRequestCall)
d.OnPhoneReceivedCall(r.onPhoneReceivedCall)
d.OnPhoneAcceptCall(r.onPhoneAcceptCall)
d.OnPhoneConfirmCall(r.onPhoneConfirmCall)
d.OnPhoneDiscardCall(r.onPhoneDiscardCall)
d.OnPhoneSendSignalingData(r.onPhoneSendSignalingData)
d.OnPhoneSetCallRating(r.onPhoneSetCallRating)
d.OnPhoneSaveCallDebug(r.onPhoneSaveCallDebug)
d.OnPhoneGetCallConfig(func(ctx context.Context) (*tg.DataJSON, error) {
// tgcalls 对空配置走默认值需要精调audio_max_bitrate 等)时再填键值。
return &tg.DataJSON{Data: "{}"}, nil
})
// 超级群语音聊天group call
d.OnPhoneCreateGroupCall(r.onPhoneCreateGroupCall)
d.OnPhoneJoinGroupCall(r.onPhoneJoinGroupCall)
d.OnPhoneLeaveGroupCall(r.onPhoneLeaveGroupCall)
d.OnPhoneDiscardGroupCall(r.onPhoneDiscardGroupCall)
d.OnPhoneGetGroupCall(r.onPhoneGetGroupCall)
d.OnPhoneGetGroupParticipants(r.onPhoneGetGroupParticipants)
d.OnPhoneCheckGroupCall(r.onPhoneCheckGroupCall)
d.OnPhoneExportGroupCallInvite(r.onPhoneExportGroupCallInvite)
d.OnPhoneEditGroupCallParticipant(r.onPhoneEditGroupCallParticipant)
d.OnPhoneEditGroupCallTitle(r.onPhoneEditGroupCallTitle)
d.OnPhoneToggleGroupCallSettings(r.onPhoneToggleGroupCallSettings)
d.OnPhoneInviteToGroupCall(r.onPhoneInviteToGroupCall)
// 定时通话scheduled video chat
d.OnPhoneStartScheduledGroupCall(r.onPhoneStartScheduledGroupCall)
d.OnPhoneToggleGroupCallStartSubscription(r.onPhoneToggleGroupCallStartSubscription)
// Ad-hoc E2E conference callP2P 通话升级/拉人路径)。
d.OnPhoneCreateConferenceCall(r.onPhoneCreateConferenceCall)
d.OnPhoneInviteConferenceCallParticipant(r.onPhoneInviteConferenceCallParticipant)
d.OnPhoneDeleteConferenceCallParticipants(r.onPhoneDeleteConferenceCallParticipants)
d.OnPhoneSendConferenceCallBroadcast(r.onPhoneSendConferenceCallBroadcast)
d.OnPhoneDeclineConferenceCallInvite(r.onPhoneDeclineConferenceCallInvite)
d.OnPhoneGetGroupCallChainBlocks(r.onPhoneGetGroupCallChainBlocks)
// 屏幕共享M4同参与者第二媒体连接。
d.OnPhoneJoinGroupCallPresentation(r.onPhoneJoinGroupCallPresentation)
d.OnPhoneLeaveGroupCallPresentation(r.onPhoneLeaveGroupCallPresentation)
r.registerPhoneStubs(d)
}