aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/TwitterManager.java28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/main/java/com/juick/TwitterManager.java b/src/main/java/com/juick/TwitterManager.java
index cb66429a..b31b5e50 100644
--- a/src/main/java/com/juick/TwitterManager.java
+++ b/src/main/java/com/juick/TwitterManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2020, Juick
+ * Copyright (C) 2008-2021, Juick
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -17,13 +17,10 @@
package com.juick;
import com.juick.model.Message;
-import com.juick.model.User;
import com.juick.www.api.SystemActivity;
-import com.juick.service.UserService;
import com.juick.service.component.*;
import com.juick.service.CrosspostService;
import com.juick.util.MessageUtils;
-import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,7 +28,6 @@ import org.springframework.beans.factory.annotation.Value;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;
-import javax.annotation.PostConstruct;
import javax.inject.Inject;
/**
@@ -48,18 +44,6 @@ public class TwitterManager implements NotificationListener {
private String twitter_consumer_key;
@Value("${twitter_consumer_secret:secret}")
private String twitter_consumer_secret;
- @Inject
- private UserService userService;
-
- @Value("${service_user:juick}")
- private String serviceUsername;
-
- private User serviceUser;
-
- @PostConstruct
- public void init() {
- serviceUser = userService.getUserByName(serviceUsername);
- }
void twitterPost(final Message jmsg) {
crosspostService.getTwitterToken(jmsg.getUser().getUid()).ifPresent(t -> {
@@ -96,10 +80,6 @@ public class TwitterManager implements NotificationListener {
twitterPost(msg);
}
}
- } else if (activity.getType().equals(SystemActivity.ActivityType.like)) {
- if (activity.getFrom().getName().equals(serviceUsername)) {
- processTop(msg);
- }
}
}
@@ -107,10 +87,4 @@ public class TwitterManager implements NotificationListener {
public void processPingEvent(PingEvent pingEvent) {
}
-
- private void processTop(Message message) {
- Message jmsg = SerializationUtils.clone(message);
- jmsg.setUser(serviceUser);
- twitterPost(jmsg);
- }
}