diff options
author | Vitaly Takmazov | 2018-06-09 10:07:17 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-06-09 10:07:17 +0300 |
commit | d2c2b4b04b7900d12f20c12209c2114e83062a9b (patch) | |
tree | 21688a3b70618f7bb4e22477c0b9dcac67b6ff20 /juick-server/src/main | |
parent | 0bc0eb15e3eaa279d65ff67f4000665df8b8f8d2 (diff) |
maven dependencies update
Diffstat (limited to 'juick-server/src/main')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/MessengerManager.java | 7 |
1 files changed, 5 insertions, 2 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 8bfcafd0..3e7f8712 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); |