mirror of
https://github.com/fluencelabs/fluid
synced 2025-06-18 07:41:20 +00:00
msg => message
This commit is contained in:
@ -8,11 +8,11 @@ export abstract class Response {
|
||||
}
|
||||
|
||||
export class Message {
|
||||
msg: string;
|
||||
message: string;
|
||||
username: string;
|
||||
|
||||
constructor(msg: string, username: string) {
|
||||
this.msg = msg;
|
||||
constructor(message: string, username: string) {
|
||||
this.message = message;
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
@ -26,7 +26,7 @@ export class UnknownResponse extends Response {
|
||||
let encoder = new JSONEncoder();
|
||||
encoder.pushObject(null);
|
||||
encoder.setString("action", "Unknown");
|
||||
encoder.setString("msg", "cannot username request");
|
||||
encoder.setString("message", "cannot username request");
|
||||
encoder.popObject();
|
||||
|
||||
return encoder.toString();
|
||||
@ -34,17 +34,16 @@ export class UnknownResponse extends Response {
|
||||
}
|
||||
|
||||
export class PostResponse extends Response {
|
||||
msgCount: u32;
|
||||
constructor(msgCount: u32) {
|
||||
count: u32;
|
||||
constructor(count: u32) {
|
||||
super();
|
||||
this.msgCount = msgCount;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
serialize(): string {
|
||||
let encoder = new JSONEncoder();
|
||||
encoder.pushObject(null);
|
||||
encoder.setString("action", "Post");
|
||||
encoder.setInteger("count", this.msgCount);
|
||||
encoder.setInteger("count", this.count);
|
||||
encoder.popObject();
|
||||
|
||||
return encoder.toString();
|
||||
@ -62,12 +61,11 @@ export class FetchResponse extends Response {
|
||||
serialize(): string {
|
||||
let encoder = new JSONEncoder();
|
||||
encoder.pushObject(null);
|
||||
encoder.setString("action", "Fetch");
|
||||
encoder.pushArray("posts");
|
||||
for (let i = 0; i < this.posts.length; i++) {
|
||||
let twit = this.posts[i];
|
||||
encoder.pushObject(null);
|
||||
encoder.setString("msg", twit.msg);
|
||||
encoder.setString("message", twit.message);
|
||||
encoder.setString("username", twit.username);
|
||||
encoder.popObject();
|
||||
}
|
||||
|
Reference in New Issue
Block a user