use of im.actor.core.entity.Message 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.entity.Message 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.entity.Message in project actor-platform by actorapp.
the class SenderActor method doSendLocation.
public void doSendLocation(@NotNull Peer peer, @NotNull Double longitude, @NotNull Double latitude, @Nullable String street, @Nullable String place) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
LocationContent content = LocationContent.create(longitude, latitude, street, place);
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.entity.Message in project actor-platform by actorapp.
the class SenderActor method doSendSticker.
// Sending sticker
public void doSendSticker(@NotNull Peer peer, @NotNull Sticker sticker) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
StickerContent content = StickerContent.create(sticker);
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.entity.Message in project actor-platform by actorapp.
the class SenderActor method doForwardContent.
public void doForwardContent(Peer peer, AbsContent content) {
long rid = RandomUtils.nextRid();
long date = createPendingDate();
long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
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);
}
Aggregations