aboutsummaryrefslogtreecommitdiff
path: root/juick-crosspost
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-15 14:21:27 +0300
committerGravatar Vitaly Takmazov2016-11-15 14:21:27 +0300
commit51d9de02265d6cc9d6045d79497d2a987ae2f7f7 (patch)
treed7dd2e534452cab45b8ebdba1e52c498951c5035 /juick-crosspost
parent32a6feb195171e06d60117ad758cc8beb50e5ca3 (diff)
core classes are now serializeable with JAXB (to use as babbler extension)
Diffstat (limited to 'juick-crosspost')
-rw-r--r--juick-crosspost/src/main/java/com/juick/components/Crosspost.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
index c82fc542..8ccca67c 100644
--- a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
+++ b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
@@ -127,7 +127,7 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
@Override
public void onMessage(final com.juick.xmpp.Message msg) {
JuickMessage jmsg = (JuickMessage) msg.getChild(JuickMessage.XMLNS);
- if (msg.to != null && msg.to.Username != null && jmsg != null && jmsg.getRID() == 0) {
+ if (msg.to != null && msg.to.Username != null && jmsg != null && jmsg.getRid() == 0) {
if (msg.to.Username.equals("twitter")) {
twitterPost(jmsg);
} else if (msg.to.Username.equals("fb")) {
@@ -139,12 +139,12 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
}
public boolean facebookPost(final com.juick.Message jmsg) {
- String token = crosspostService.getFacebookToken(jmsg.getUser().getUID()).orElse("");
+ String token = crosspostService.getFacebookToken(jmsg.getUser().getUid()).orElse("");
if (token.isEmpty()) {
return false;
}
- logger.info("FB: #" + jmsg.getMID());
+ logger.info("FB: #" + jmsg.getMid());
String status = getMessageHashTags(jmsg) + "\n" + jmsg.getText();
@@ -155,7 +155,7 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
+ "&message="
+ URLEncoder.encode(status, "UTF-8")
+ "&link=http%3A%2F%2Fjuick.com%2F"
- + jmsg.getMID();
+ + jmsg.getMid();
HttpsURLConnection conn = (HttpsURLConnection) new URL(FBURL).openConnection();
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
@@ -181,14 +181,14 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
}
public boolean vkontaktePost(final com.juick.Message jmsg) {
- Pair<String, String> tokens = crosspostService.getVkTokens(jmsg.getUser().getUID()).orElse(Pair.of("", ""));
+ Pair<String, String> tokens = crosspostService.getVkTokens(jmsg.getUser().getUid()).orElse(Pair.of("", ""));
if (tokens.getLeft().isEmpty() || tokens.getRight().isEmpty()) {
return false;
}
- logger.info("VK: #" + jmsg.getMID());
+ logger.info("VK: #" + jmsg.getMid());
- String status = getMessageHashTags(jmsg) + "\n" + jmsg.getText() + "\nhttp://juick.com/" + jmsg.getMID();
+ String status = getMessageHashTags(jmsg) + "\n" + jmsg.getText() + "\nhttp://juick.com/" + jmsg.getMid();
boolean ret = false;
try {
@@ -218,20 +218,20 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
}
public boolean twitterPost(final com.juick.Message jmsg) {
- Pair<String, String> tokens = crosspostService.getTwitterTokens(jmsg.getUser().getUID()).orElse(Pair.of("", ""));
+ Pair<String, String> tokens = crosspostService.getTwitterTokens(jmsg.getUser().getUid()).orElse(Pair.of("", ""));
if (tokens.getLeft().isEmpty() || tokens.getRight().isEmpty()) {
return false;
}
String token = percentEncode(tokens.getLeft());
String token_secret = percentEncode(tokens.getRight());
- logger.info("TWITTER: #" + jmsg.getMID());
+ logger.info("TWITTER: #" + jmsg.getMid());
String status = getMessageHashTags(jmsg) + jmsg.getText();
if (status.length() > 115) {
status = status.substring(0, 114) + "…";
}
- status += " http://juick.com/" + jmsg.getMID();
+ status += " http://juick.com/" + jmsg.getMid();
status = percentEncode(status);
boolean ret = false;
@@ -316,8 +316,8 @@ public class Crosspost implements InitializingBean, DisposableBean, Stream.Strea
public String getMessageHashTags(final com.juick.Message jmsg) {
String hashtags = "";
- for (int i = 0; i < jmsg.Tags.size(); i++) {
- hashtags += "#" + jmsg.Tags.get(i) + " ";
+ for (int i = 0; i < jmsg.getTags().size(); i++) {
+ hashtags += "#" + jmsg.getTags().get(i) + " ";
}
return hashtags;
}