Skip to content

Commit

Permalink
Add HOME menu call cancellation support
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntii committed Jul 6, 2023
1 parent d6bbefc commit 3a587ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ import (
"google.golang.org/grpc/metadata"
)

func SendIncomingCallNotification(caller uint32, target uint32) {
func SendFriendsNotification(caller uint32, target uint32, ringing bool) {
ctx := metadata.NewOutgoingContext(context.Background(), globals.GRPCFriendsCommonMetadata)

presence := friends_wiiu_types.NewNintendoPresenceV2()

presence.ChangedFlags = 0x1FF
presence.Online = true
presence.GameKey = friends_wiiu_types.NewGameKey()
presence.Unknown2 = 0x65
presence.GameServerID = 0x1005A000
presence.PID = 1 // This is not a PID, but the amount of times the PID is repeated in bytes in the application data.
presence.GatheringID = caller

if ringing {
presence.Unknown2 = 0x65
}

targetBytes := make([]byte, 4)
binary.BigEndian.PutUint32(targetBytes, target)

Expand Down
4 changes: 3 additions & 1 deletion nex/matchmake-extension/update_notification_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func UpdateNotificationData(err error, client *nex.Client, callID uint32, uiType
if recipientClient != nil && recipientClient.StationURLs() != nil {
nex_notifications.ProcessNotificationEvent(callID, client.PID(), notificationType, uiParam1, uiParam2, strParam)
} else {
grpc.SendIncomingCallNotification(client.PID(), uiParam2)
grpc.SendFriendsNotification(client.PID(), uiParam2, true)
}
}

Expand All @@ -35,6 +35,8 @@ func UpdateNotificationData(err error, client *nex.Client, callID uint32, uiType

if recipientClient != nil && recipientClient.StationURLs() != nil {
nex_notifications.ProcessNotificationEvent(callID, client.PID(), notificationType, uiParam1, uiParam2, strParam)
} else {
grpc.SendFriendsNotification(client.PID(), uiParam2, false)
}

// The user must be kicked, otherwise the app hangs forever.
Expand Down

0 comments on commit 3a587ed

Please sign in to comment.