Skip to main content

Muting and Unmuting a User

Users have the ability to disable updates from other user’s mods. This will prevent mod.io from returning mods authored by the muted user. There are three actions available to take: mute a user, unmute a user, and list muted users

note

To perform any of these actions, the muting user must be authenticated.

Mute a user

To mute a user, call MuteUserAsync with the corresponding ModioUserID and a callback.


void UModioManagerSubsystem::MuteAUser(FModioUserID UserID)
{
if (UModioSubsystem* Subsystem = GEngine->GetEngineSubsystem<UModioSubsystem>())
{
Subsystem->MuteUserAsync(UserID, FOnErrorOnlyDelegateFast::CreateUObject(this, &UModioManagerSubsystem::OnMuteUserComplete));
}
}

void UModioManagerSubsystem::OnMuteUserComplete(FModioErrorCode ErrorCode)
{
if (!ErrorCode)
{
// User successfully muted
}
}

Unmute a user

To perform the inverse operation call UnmuteUserAsync with the corresponding ModioUserID and a callback.


void UModioManagerSubsystem::UnmuteAUser(FModioUserID UserID)
{
if (UModioSubsystem* Subsystem = GEngine->GetEngineSubsystem<UModioSubsystem>())
{
Subsystem->UnmuteUserAsync(UserID, FOnErrorOnlyDelegateFast::CreateUObject(this, &UModioManagerSubsystem::OnUnmuteUserComplete));
}
}

void UModioManagerSubsystem::OnUnmuteUserComplete(FModioErrorCode ErrorCode)
{
if (!ErrorCode)
{
// User successfully unmuted
}
}

List muted users

GetMutedUsersAsync returns a list of users previously muted by an authenticated user.


void UModioManagerSubsystem::ListMutedUsers()
{
if (UModioSubsystem* Subsystem = GEngine->GetEngineSubsystem<UModioSubsystem>())
{
Subsystem->GetMutedUsersAsync(FOnMuteUsersDelegateFast::CreateUObject(this, &UModioManagerSubsystem::OnListMutedUsersComplete));
}
}

void UModioManagerSubsystem::OnListMutedUsersComplete(FModioErrorCode ErrorCode, FModioOptionalUserList MutedUsers)
{
if (!ErrorCode)
{
// List of muted users successfully retrieved
}
}