diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/MessengerManager.java | 7 |
1 files changed, 4 insertions, 3 deletions
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 2979fa28..14a43d6a 100644 --- a/juick-server/src/main/java/com/juick/server/MessengerManager.java +++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java @@ -5,6 +5,7 @@ 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.MessagingType; import com.github.messenger4j.send.message.TemplateMessage; import com.github.messenger4j.send.message.TextMessage; import com.github.messenger4j.send.message.template.ButtonTemplate; @@ -125,9 +126,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, TemplateMessage.create(template))); + messenger.send(MessagePayload.create(messengerUser, MessagingType.NON_PROMOTIONAL_SUBSCRIPTION, TemplateMessage.create(template))); } else { - messenger.send(MessagePayload.create(messengerUser, TextMessage.create(text))); + messenger.send(MessagePayload.create(messengerUser, MessagingType.NON_PROMOTIONAL_SUBSCRIPTION, TextMessage.create(text))); } } catch (MessengerApiException | MessengerIOException | MalformedURLException e) { logger.warn("messenger error", e); @@ -138,6 +139,6 @@ public class MessengerManager implements ApplicationListener<MessageEvent> { new URL("https://juick.com/signup?type=messenger&hash=" + hash)); ButtonTemplate template = ButtonTemplate.create("Login to receive notifications", Collections.singletonList(urlButton)); - messenger.send(MessagePayload.create(messengerUser, TemplateMessage.create(template))); + messenger.send(MessagePayload.create(messengerUser, MessagingType.RESPONSE, TemplateMessage.create(template))); } } |