Изменение структуры сообщения (без Encoding)
All checks were successful
Build rosetta-wss / build (push) Successful in 1m30s

This commit is contained in:
RoyceDa
2026-03-29 15:52:12 +02:00
parent f45d2731a4
commit 5f679df5cf
3 changed files with 2 additions and 42 deletions

View File

@@ -4,7 +4,6 @@ import java.util.List;
import im.rosetta.packet.base.PacketBaseDialog;
import im.rosetta.packet.runtime.Attachment;
import im.rosetta.packet.runtime.AttachmentEncoding;
import im.rosetta.packet.runtime.AttachmentTransport;
import im.rosetta.packet.runtime.AttachmentType;
@@ -63,10 +62,7 @@ public class Packet6Message extends PacketBaseDialog {
String transportTag = stream.readString();
String transportServer = stream.readString();
AttachmentTransport transport = new AttachmentTransport(transportTag, transportServer);
String encodedFor = stream.readString();
String encoder = stream.readString();
AttachmentEncoding encoding = new AttachmentEncoding(encoder, encodedFor);
this.attachments.add(new Attachment(id, blob, type, preview, encoding, transport));
this.attachments.add(new Attachment(id, blob, type, preview, transport));
}
this.aesChachaKey = stream.readString();
}
@@ -90,8 +86,6 @@ public class Packet6Message extends PacketBaseDialog {
stream.writeInt8((byte) attachment.getType().getCode());
stream.writeString(attachment.getTransport().getTransportTag());
stream.writeString(attachment.getTransport().getTransportServer());
stream.writeString(attachment.getEncoding().getEncoder());
stream.writeString(attachment.getEncoding().getEncodedFor());
}
stream.writeString(this.aesChachaKey);
return stream;

View File

@@ -9,15 +9,13 @@ public class Attachment {
private String blob;
private AttachmentType type;
private String preview;
private AttachmentEncoding encoding;
private AttachmentTransport transport;
public Attachment(String id, String blob, AttachmentType type, String preview, AttachmentEncoding encoding, AttachmentTransport transport) {
public Attachment(String id, String blob, AttachmentType type, String preview, AttachmentTransport transport) {
this.id = id;
this.blob = blob;
this.type = type;
this.preview = preview;
this.encoding = encoding;
this.transport = transport;
}
@@ -53,14 +51,6 @@ public class Attachment {
return preview;
}
/**
* Получить информацию о том, как было закодировано вложение
* @return
*/
public AttachmentEncoding getEncoding() {
return encoding;
}
/**
* Получить информацию о том, как доставлять вложение
* @return

View File

@@ -1,24 +0,0 @@
package im.rosetta.packet.runtime;
/**
* Класс для хранения информации о том, как было закодировано вложение в сообщении
*/
public class AttachmentEncoding {
private String encoder;
private String encodedFor;
public AttachmentEncoding(String encoder, String encodedFor) {
this.encoder = encoder;
this.encodedFor = encodedFor;
}
public String getEncoder() {
return encoder;
}
public String getEncodedFor() {
return encodedFor;
}
}