[core] GOWS - send media via file
This commit is contained in:
1 parent
e01647eb48
commit
2ac57bb6c3
2 files changed
+54
-1
No files matched your search
@@ -2687,6 +2687,7 @@ export namespace messages {
|
||||
mimetype?: string;
|
||||
audio?: AudioInfo;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@@ -2706,6 +2707,9 @@ export namespace messages {
|
||||
if ("filename" in data && data.filename != undefined) {
|
||||
this.filename = data.filename;
|
||||
}
|
||||
if ("contentPath" in data && data.contentPath != undefined) {
|
||||
this.contentPath = data.contentPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
get content() {
|
||||
@@ -2741,12 +2745,19 @@ export namespace messages {
|
||||
set filename(value: string) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
get contentPath() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||
}
|
||||
set contentPath(value: string) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
content?: Uint8Array;
|
||||
type?: MediaType;
|
||||
mimetype?: string;
|
||||
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
}): Media {
|
||||
const message = new Media({});
|
||||
if (data.content != null) {
|
||||
@@ -2764,6 +2775,9 @@ export namespace messages {
|
||||
if (data.filename != null) {
|
||||
message.filename = data.filename;
|
||||
}
|
||||
if (data.contentPath != null) {
|
||||
message.contentPath = data.contentPath;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@@ -2773,6 +2787,7 @@ export namespace messages {
|
||||
mimetype?: string;
|
||||
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
} = {};
|
||||
if (this.content != null) {
|
||||
data.content = this.content;
|
||||
@@ -2789,6 +2804,9 @@ export namespace messages {
|
||||
if (this.filename != null) {
|
||||
data.filename = this.filename;
|
||||
}
|
||||
if (this.contentPath != null) {
|
||||
data.contentPath = this.contentPath;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@@ -2805,6 +2823,8 @@ export namespace messages {
|
||||
writer.writeMessage(4, this.audio, () => this.audio.serialize(writer));
|
||||
if (this.filename.length)
|
||||
writer.writeString(5, this.filename);
|
||||
if (this.contentPath.length)
|
||||
writer.writeString(6, this.contentPath);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@@ -2829,6 +2849,9 @@ export namespace messages {
|
||||
case 5:
|
||||
message.filename = reader.readString();
|
||||
break;
|
||||
case 6:
|
||||
message.contentPath = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7115,7 +7115,8 @@ proto.messages.Media.toObject = function(includeInstance, msg) {
|
||||
type: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
||||
mimetype: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
audio: (f = msg.getAudio()) && proto.messages.AudioInfo.toObject(includeInstance, f),
|
||||
filename: jspb.Message.getFieldWithDefault(msg, 5, "")
|
||||
filename: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
||||
contentpath: jspb.Message.getFieldWithDefault(msg, 6, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -7173,6 +7174,10 @@ proto.messages.Media.deserializeBinaryFromReader = function(msg, reader) {
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setFilename(value);
|
||||
break;
|
||||
case 6:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setContentpath(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -7238,6 +7243,13 @@ proto.messages.Media.serializeBinaryToWriter = function(message, writer) {
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getContentpath();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
6,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -7374,6 +7386,24 @@ proto.messages.Media.prototype.setFilename = function(value) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string contentPath = 6;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.messages.Media.prototype.getContentpath = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.messages.Media} returns this
|
||||
*/
|
||||
proto.messages.Media.prototype.setContentpath = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 6, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user