use of im.actor.core.modules.messaging.actions.entity.PendingMessage in project actor-platform by actorapp.
the class SenderActor method doSendAudio.
public void doSendAudio(Peer peer, String descriptor, String fileName, int fileSize, int duration) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
VoiceContent audioContent = VoiceContent.createLocalAudio(descriptor, fileName, fileSize, duration);
Message message = new Message(rid, sortDate, date, myUid(), MessageState.PENDING, audioContent);
context().getMessagesModule().getRouter().onOutgoingMessage(peer, message);
pendingMessages.getPendingMessages().add(new PendingMessage(peer, rid, audioContent));
savePending();
performUploadFile(rid, descriptor, fileName);
}
use of im.actor.core.modules.messaging.actions.entity.PendingMessage in project actor-platform by actorapp.
the class SenderActor method doSendPhoto.
public void doSendPhoto(Peer peer, FastThumb fastThumb, String descriptor, String fileName, int fileSize, int w, int h) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
PhotoContent photoContent = PhotoContent.createLocalPhoto(descriptor, fileName, fileSize, w, h, fastThumb);
Message message = new Message(rid, sortDate, date, myUid(), MessageState.PENDING, photoContent);
context().getMessagesModule().getRouter().onOutgoingMessage(peer, message);
pendingMessages.getPendingMessages().add(new PendingMessage(peer, rid, photoContent));
savePending();
performUploadFile(rid, descriptor, fileName);
}
use of im.actor.core.modules.messaging.actions.entity.PendingMessage in project actor-platform by actorapp.
the class SenderActor method doSendContact.
public void doSendContact(@NotNull Peer peer, @NotNull ArrayList<String> emails, @NotNull ArrayList<String> phones, @Nullable String name, @Nullable String base64photo) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
ContactContent content = ContactContent.create(name, phones, emails, base64photo);
Message message = new Message(rid, sortDate, date, myUid(), MessageState.PENDING, content);
context().getMessagesModule().getRouter().onOutgoingMessage(peer, message);
pendingMessages.getPendingMessages().add(new PendingMessage(peer, rid, content));
savePending();
performSendContent(peer, rid, content);
}
use of im.actor.core.modules.messaging.actions.entity.PendingMessage in project actor-platform by actorapp.
the class SenderActor method doSendVideo.
public void doSendVideo(Peer peer, String fileName, int w, int h, int duration, FastThumb fastThumb, String descriptor, int fileSize) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
VideoContent videoContent = VideoContent.createLocalVideo(descriptor, fileName, fileSize, w, h, duration, fastThumb);
Message message = new Message(rid, sortDate, date, myUid(), MessageState.PENDING, videoContent);
context().getMessagesModule().getRouter().onOutgoingMessage(peer, message);
pendingMessages.getPendingMessages().add(new PendingMessage(peer, rid, videoContent));
savePending();
performUploadFile(rid, descriptor, fileName);
}
use of im.actor.core.modules.messaging.actions.entity.PendingMessage in project actor-platform by actorapp.
the class SenderActor method onError.
private void onError(Peer peer, long rid) {
for (PendingMessage pending : pendingMessages.getPendingMessages()) {
if (pending.getRid() == rid && pending.getPeer().equals(peer)) {
pendingMessages.getPendingMessages().remove(pending);
break;
}
}
savePending();
context().getMessagesModule().getRouter().onOutgoingError(peer, rid);
}
Aggregations