aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/build.gradle4
-rw-r--r--juick-server/src/main/java/com/juick/server/MessengerManager.java7
2 files changed, 7 insertions, 4 deletions
diff --git a/juick-server/build.gradle b/juick-server/build.gradle
index 4af01a0b0..d75a9bffb 100644
--- a/juick-server/build.gradle
+++ b/juick-server/build.gradle
@@ -12,7 +12,7 @@ dependencies {
compile 'io.springfox:springfox-swagger-ui:2.9.0'
compile 'com.github.pengrad:java-telegram-bot-api:3.6.0'
- compile 'com.github.messenger4j:messenger4j:1.0.0-M3'
+ compile 'com.github.messenger4j:messenger4j:1.0.0'
compile 'org.springframework.social:spring-social-twitter:1.1.2.RELEASE'
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'org.twitter4j:twitter4j-core:4.0.6'
@@ -27,7 +27,7 @@ dependencies {
compile "javax.inject:javax.inject:1"
compile "javax.xml.bind:jaxb-api:2.3.0"
- compile 'org.glassfish.jaxb:jaxb-runtime:2.3.0'
+ compile 'org.glassfish.jaxb:jaxb-runtime:2.3.0.1'
compile 'com.rometools:rome:1.10.0'
compile 'com.rometools:rome-modules:1.10.0'
diff --git a/juick-server/src/main/java/com/juick/server/MessengerManager.java b/juick-server/src/main/java/com/juick/server/MessengerManager.java
index 8bfcafd09..3e7f87126 100644
--- a/juick-server/src/main/java/com/juick/server/MessengerManager.java
+++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java
@@ -5,11 +5,14 @@ import com.github.messenger4j.exception.MessengerApiException;
import com.github.messenger4j.exception.MessengerIOException;
import com.github.messenger4j.exception.MessengerVerificationException;
import com.github.messenger4j.send.MessagePayload;
+import com.github.messenger4j.send.MessageTag;
import com.github.messenger4j.send.MessagingType;
+import com.github.messenger4j.send.NotificationType;
import com.github.messenger4j.send.message.TemplateMessage;
import com.github.messenger4j.send.message.TextMessage;
import com.github.messenger4j.send.message.template.ButtonTemplate;
import com.github.messenger4j.send.message.template.button.UrlButton;
+import com.github.messenger4j.send.recipient.IdRecipient;
import com.github.messenger4j.userprofile.UserProfile;
import com.github.messenger4j.webhook.event.TextMessageEvent;
import com.juick.Message;
@@ -129,9 +132,9 @@ public class MessengerManager implements ApplicationListener<MessageEvent> {
if (!StringUtils.isEmpty(url)) {
final UrlButton showMessage = UrlButton.create("VIEW MESSAGE", new URL(url));
ButtonTemplate template = ButtonTemplate.create(text, Collections.singletonList(showMessage));
- messenger.send(MessagePayload.create(messengerUser, MessagingType.NON_PROMOTIONAL_SUBSCRIPTION, TemplateMessage.create(template)));
+ messenger.send(MessagePayload.create(IdRecipient.create(messengerUser), MessagingType.UPDATE, TemplateMessage.create(template), Optional.of(NotificationType.REGULAR), Optional.of(MessageTag.NON_PROMOTIONAL_SUBSCRIPTION)));
} else {
- messenger.send(MessagePayload.create(messengerUser, MessagingType.NON_PROMOTIONAL_SUBSCRIPTION, TextMessage.create(text)));
+ messenger.send(MessagePayload.create(IdRecipient.create(messengerUser), MessagingType.UPDATE, TextMessage.create(text), Optional.of(NotificationType.REGULAR), Optional.of(MessageTag.NON_PROMOTIONAL_SUBSCRIPTION)));
}
} catch (MessengerApiException | MessengerIOException | MalformedURLException e) {
logger.warn("messenger error", e);