本文整理汇总了Java中org.whispersystems.signalservice.api.SignalServiceMessageReceiver类的典型用法代码示例。如果您正苦于以下问题:Java SignalServiceMessageReceiver类的具体用法?Java SignalServiceMessageReceiver怎么用?Java SignalServiceMessageReceiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SignalServiceMessageReceiver类属于org.whispersystems.signalservice.api包,在下文中一共展示了SignalServiceMessageReceiver类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SofaMessageReceiver
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
public SofaMessageReceiver(@NonNull final HDWallet wallet,
@NonNull final ProtocolStore protocolStore,
@NonNull final ConversationStore conversationStore,
@NonNull final SignalServiceUrl[] urls,
@NonNull final SofaMessageSender messageSender) {
this.wallet = wallet;
this.protocolStore = protocolStore;
this.messageReceiver =
new SignalServiceMessageReceiver(
new SignalServiceConfiguration(urls, new SignalCdnUrl[0]),
this.wallet.getOwnerAddress(),
this.protocolStore.getPassword(),
this.protocolStore.getSignalingKey(),
USER_AGENT);
this.taskGroupUpdate = new GroupUpdateTask(this.messageReceiver, messageSender, conversationStore);
this.taskHandleMessage = new HandleMessageTask(this.messageReceiver, conversationStore, this.wallet, messageSender);
}
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:19,代码来源:SofaMessageReceiver.java
示例2: writeAttachmentToFileFromMessageReceiver
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
private @Nullable static File writeAttachmentToFileFromMessageReceiver(
final SignalServiceAttachmentPointer attachment,
final SignalServiceMessageReceiver messageReceiver,
final String fileId) {
File file = null;
try {
final String tempName = String.format("%d", attachment.getId());
file = new File(BaseApplication.get().getCacheDir(), tempName);
final int maxFileSize = 20 * 1024 * 1024;
final InputStream inputStream = messageReceiver.retrieveAttachment(attachment, file, maxFileSize);
final File destFile = constructAttachmentFile(attachment.getContentType(), fileId);
return writeToFileFromInputStream(destFile, inputStream);
} catch (IOException | InvalidMessageException e) {
LogUtil.exception(FileUtil.class, "Error during writing attachment to file", e);
return null;
} finally {
if (file != null) {
file.delete();
}
}
}
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:23,代码来源:FileUtil.java
示例3: onRun
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
@Override
public void onRun() throws IOException {
receiver.retrieveMessages(new SignalServiceMessageReceiver.MessageReceivedCallback() {
@Override
public void onMessage(SignalServiceEnvelope envelope) {
handle(envelope, false);
}
});
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:10,代码来源:PushNotificationReceiveJob.java
示例4: processFromSignalGroup
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
public static Single<Avatar> processFromSignalGroup(final SignalServiceGroup group, final SignalServiceMessageReceiver messageReceiver) {
if (group.getAvatar().isPresent()) {
return Single.fromCallable(() -> {
final SignalServiceAttachmentPointer attachment = group.getAvatar().get().asPointer();
final String groupId = Hex.toHexString(group.getGroupId());
return FileUtil.writeAvatarToFileFromMessageReceiver(attachment, messageReceiver, groupId);
})
.flatMap(Avatar::compressImage)
.map(File::getAbsolutePath)
.map(BitmapFactory::decodeFile)
.map(Avatar::new);
}
return Single.just(new Avatar());
}
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:16,代码来源:Avatar.java
示例5: retrieveAttachmentAsStream
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
private InputStream retrieveAttachmentAsStream(SignalServiceAttachmentPointer pointer, File tmpFile) throws IOException, InvalidMessageException {
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, localIdentity.getToshiId(), localIdentity.getPassword(), Base64.encodeBytes(localIdentity.getSignalingKey()), USER_AGENT);
return messageReceiver.retrieveAttachment(pointer, tmpFile, MAX_ATTACHEMENT_SIZE_BYTES);
}
开发者ID:toshiapp,项目名称:toshi-headless-client,代码行数:5,代码来源:Manager.java
示例6: provideSignalMessageReceiver
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
@Provides SignalServiceMessageReceiver provideSignalMessageReceiver() {
return new SignalServiceMessageReceiver(networkAccess.getConfiguration(context),
new DynamicCredentialsProvider(context),
BuildConfig.USER_AGENT);
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:6,代码来源:SignalCommunicationModule.java
示例7: writeAvatarToFileFromMessageReceiver
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
public @Nullable static File writeAvatarToFileFromMessageReceiver(
final SignalServiceAttachmentPointer attachment,
final SignalServiceMessageReceiver messageReceiver,
final String groupId) {
return writeAttachmentToFileFromMessageReceiver(attachment, messageReceiver, groupId);
}
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:7,代码来源:FileUtil.java
示例8: retrieveAttachmentAsStream
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver; //导入依赖的package包/类
private InputStream retrieveAttachmentAsStream(SignalServiceAttachmentPointer pointer, File tmpFile) throws IOException, InvalidMessageException {
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceConfiguration, username, password, deviceId, signalingKey, USER_AGENT, null);
return messageReceiver.retrieveAttachment(pointer, tmpFile, MAX_ATTACHMENT_SIZE);
}
开发者ID:AsamK,项目名称:signal-cli,代码行数:5,代码来源:Manager.java
注:本文中的org.whispersystems.signalservice.api.SignalServiceMessageReceiver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论