Fixed incorrectly logging of server actions
This commit is contained in:
parent
8a488ff98a
commit
2758537d80
1 changed files with 22 additions and 15 deletions
|
@ -56,6 +56,25 @@ namespace connection {
|
||||||
this["notifyconversationmessagedelete"] = this.handleNotifyConversationMessageDelete;
|
this["notifyconversationmessagedelete"] = this.handleNotifyConversationMessageDelete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private loggable_invoker(unique_id, client_id, name) : log.server.base.Client | undefined {
|
||||||
|
const id = parseInt(client_id);
|
||||||
|
if(typeof(client_id) === "undefined" || Number.isNaN(id))
|
||||||
|
return undefined;
|
||||||
|
|
||||||
|
if(id == 0)
|
||||||
|
return {
|
||||||
|
client_id: 0,
|
||||||
|
client_unique_id: this.connection_handler.channelTree.server.properties.virtualserver_unique_identifier,
|
||||||
|
client_name: this.connection_handler.channelTree.server.properties.virtualserver_name,
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
client_unique_id: unique_id,
|
||||||
|
client_name: name,
|
||||||
|
client_id: client_id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
proxy_command_promise(promise: Promise<CommandResult>, options: connection.CommandOptions) {
|
proxy_command_promise(promise: Promise<CommandResult>, options: connection.CommandOptions) {
|
||||||
if(!options.process_result)
|
if(!options.process_result)
|
||||||
return promise;
|
return promise;
|
||||||
|
@ -390,11 +409,7 @@ namespace connection {
|
||||||
channel_from: old_channel ? old_channel.log_data() : undefined,
|
channel_from: old_channel ? old_channel.log_data() : undefined,
|
||||||
channel_to: channel ? channel.log_data() : undefined,
|
channel_to: channel ? channel.log_data() : undefined,
|
||||||
client: client.log_data(),
|
client: client.log_data(),
|
||||||
invoker: invokeruid ? {
|
invoker: this.loggable_invoker(invokeruid, invokerid, invokername),
|
||||||
client_id: invokerid,
|
|
||||||
client_name: invokername,
|
|
||||||
client_unique_id: invokeruid
|
|
||||||
} : undefined,
|
|
||||||
message:reason_msg,
|
message:reason_msg,
|
||||||
reason: parseInt(reason_id),
|
reason: parseInt(reason_id),
|
||||||
own_channel: channel == own_channel
|
own_channel: channel == own_channel
|
||||||
|
@ -499,11 +514,7 @@ namespace connection {
|
||||||
channel_from: channel_from ? channel_from.log_data() : undefined,
|
channel_from: channel_from ? channel_from.log_data() : undefined,
|
||||||
channel_to: channel_to ? channel_to.log_data() : undefined,
|
channel_to: channel_to ? channel_to.log_data() : undefined,
|
||||||
client: client.log_data(),
|
client: client.log_data(),
|
||||||
invoker: entry["invokeruid"] ? {
|
invoker: this.loggable_invoker(entry["invokeruid"], entry["invokerid"], entry["invokername"]),
|
||||||
client_id: entry["invokerid"],
|
|
||||||
client_name: entry["invokername"],
|
|
||||||
client_unique_id: entry["invokeruid"]
|
|
||||||
} : undefined,
|
|
||||||
message: entry["reasonmsg"],
|
message: entry["reasonmsg"],
|
||||||
reason: parseInt(entry["reasonid"]),
|
reason: parseInt(entry["reasonid"]),
|
||||||
ban_time: parseInt(entry["bantime"]),
|
ban_time: parseInt(entry["bantime"]),
|
||||||
|
@ -632,11 +643,7 @@ namespace connection {
|
||||||
},
|
},
|
||||||
client_own: self,
|
client_own: self,
|
||||||
|
|
||||||
invoker: json["invokeruid"] ? {
|
invoker: this.loggable_invoker(json["invokeruid"], json["invokerid"], json["invokername"]),
|
||||||
client_id: parseInt(json["invokerid"]),
|
|
||||||
client_name: json["invokername"],
|
|
||||||
client_unique_id: json["invokeruid"]
|
|
||||||
} : undefined,
|
|
||||||
|
|
||||||
message: json["reasonmsg"],
|
message: json["reasonmsg"],
|
||||||
reason: parseInt(json["reasonid"]),
|
reason: parseInt(json["reasonid"]),
|
||||||
|
|
Loading…
Add table
Reference in a new issue