Java Code Examples for org.whispersystems.signalservice.api.messages.SignalServiceDataMessage#Preview
The following examples show how to use
org.whispersystems.signalservice.api.messages.SignalServiceDataMessage#Preview .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsonPreview.java From signald with GNU General Public License v3.0 | 5 votes |
JsonPreview(SignalServiceDataMessage.Preview preview, String username) throws IOException, NoSuchAccountException { url = preview.getUrl(); title = preview.getTitle(); if(preview.getImage().isPresent()) { attachment = new JsonAttachment(preview.getImage().get(), username); } }
Example 2
Source File: JsonDataMessage.java From signald with GNU General Public License v3.0 | 5 votes |
JsonDataMessage(SignalServiceDataMessage dataMessage, String username) throws IOException, NoSuchAccountException { this.timestamp = dataMessage.getTimestamp(); if (dataMessage.getGroupInfo().isPresent()) { this.groupInfo = new JsonGroupInfo(dataMessage.getGroupInfo().get(), username); } if (dataMessage.getBody().isPresent()) { this.message = dataMessage.getBody().get(); } this.expiresInSeconds = dataMessage.getExpiresInSeconds(); if (dataMessage.getAttachments().isPresent()) { this.attachments = new ArrayList<>(dataMessage.getAttachments().get().size()); for (SignalServiceAttachment attachment : dataMessage.getAttachments().get()) { this.attachments.add(new JsonAttachment(attachment, username)); } } else { this.attachments = new ArrayList<>(); } if(dataMessage.getQuote().isPresent()) { this.quote = dataMessage.getQuote().get(); } if(dataMessage.getPreviews().isPresent()) { previews = new ArrayList<JsonPreview>(); for(SignalServiceDataMessage.Preview p : dataMessage.getPreviews().get()) { previews.add(new JsonPreview(p, username)); } } if(dataMessage.getSticker().isPresent()) { this.sticker = new JsonSticker(dataMessage.getSticker().get(), username); } }