Skip to content

Commit

Permalink
Remove VKLinkEntryUser, TelegramLinkEntryUser
Browse files Browse the repository at this point in the history
  • Loading branch information
bivashy committed Jul 10, 2023
1 parent 79ec6e7 commit b3dc640
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 38 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.mastercapexd.auth.step.impl.link;

import java.util.function.Predicate;

import com.bivashy.auth.api.AuthPlugin;
import com.bivashy.auth.api.account.Account;
import com.bivashy.auth.api.config.message.Messages;
Expand All @@ -15,15 +17,17 @@
import com.bivashy.messenger.common.keyboard.Keyboard;

import me.mastercapexd.auth.config.message.server.ServerMessageContext;
import me.mastercapexd.auth.link.user.entry.BaseLinkEntryUser;
import me.mastercapexd.auth.step.AuthenticationStepTemplate;

public class MessengerAuthenticationStep extends AuthenticationStepTemplate implements MessageableAuthenticationStep {
private static final AuthPlugin PLUGIN = AuthPlugin.instance();
private final LinkEntryUser linkEntryUser;

public MessengerAuthenticationStep(String stepName, AuthenticationStepContext authenticationStepContext, LinkEntryUser linkEntryUser) {
public MessengerAuthenticationStep(String stepName, AuthenticationStepContext authenticationStepContext, LinkType linkType, Predicate<LinkUser> filter) {
super(stepName, authenticationStepContext);
this.linkEntryUser = linkEntryUser;
Account account = authenticationStepContext.getAccount();
this.linkEntryUser = new BaseLinkEntryUser(linkType, account, account.findFirstLinkUserOrNew(filter, linkType).getLinkUserInfo());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import com.bivashy.auth.api.step.AuthenticationStep;
import com.bivashy.auth.api.step.AuthenticationStepContext;

import me.mastercapexd.auth.link.telegram.TelegramLinkEntryUser;
import me.mastercapexd.auth.link.telegram.TelegramLinkType;
import me.mastercapexd.auth.step.creators.AuthenticationStepFactoryTemplate;

public class TelegramLinkAuthenticationStep extends MessengerAuthenticationStep {
public static final String STEP_NAME = "TELEGRAM_LINK";

public TelegramLinkAuthenticationStep(AuthenticationStepContext context) {
super(STEP_NAME, context, new TelegramLinkEntryUser(context.getAccount()));
super(STEP_NAME, context, TelegramLinkType.getInstance(), TelegramLinkType.LINK_USER_FILTER);
}

public static class TelegramLinkAuthenticationStepFactory extends AuthenticationStepFactoryTemplate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import com.bivashy.auth.api.step.AuthenticationStep;
import com.bivashy.auth.api.step.AuthenticationStepContext;

import me.mastercapexd.auth.link.vk.VKLinkEntryUser;
import me.mastercapexd.auth.link.vk.VKLinkType;
import me.mastercapexd.auth.step.creators.AuthenticationStepFactoryTemplate;

public class VKLinkAuthenticationStep extends MessengerAuthenticationStep {
public static final String STEP_NAME = "VK_LINK";

public VKLinkAuthenticationStep(AuthenticationStepContext context) {
super(STEP_NAME, context, new VKLinkEntryUser(context.getAccount()));
super(STEP_NAME, context, VKLinkType.getInstance(), VKLinkType.LINK_USER_FILTER);
}

public static class VKLinkAuthenticationStepFactory extends AuthenticationStepFactoryTemplate {
Expand Down

0 comments on commit b3dc640

Please sign in to comment.