private void SendUserMessage(ClientMessage cmessage, Transceiver connection) { Message message = new Message(); message.type = Message.Type.UserToUser; message.destination_plugin_hash = cmessage.Get("destination"); Chat content = new Chat(); content.AddContent("message", cmessage.Get("message")); content.AddContent("time", cmessage.Get("time")); message.content = content; connection.Write(message); Logger.log("Messenger: Chat message sent.", Logger.Verbosity.moderate); }
private void SendRequest(string username, Transceiver connection) { Message message = new Message(); message.type = Message.Type.ServerToUserPlugin; message.creator_plugin_hash = this._hash_code; message.destination_plugin_hash = this._user_manager_hash; Command content = new Command(); content.ctype = "information"; content.AddContent("username", username); message.content = content; connection.Write(message); Logger.log("Messenger: Requesting information for chat.", Logger.Verbosity.moderate); this.SendUINotice("Requesting information."); }
private void send_plugin_list(Transceiver origin, PluginManager manager) { origin.Write(this.create_plugin_list(manager)); }
private void SendPluginListing(Transceiver connection) { connection.Write(this.create_plugin_list(this._controller.plugins)); }
private void SendKeyInformation(Transceiver connection) { this.SendUINotice("Sending public key to server."); Message message = new Message(); message.creator_plugin_hash = this._hash_code; message.destination_plugin_hash = this._server_cryptor_hash; message.type = Message.Type.UserToServerPlugin; Information content = new Information(); content.type = BasicContent.Type.Information; content.AddContent("publickey", this._local_public_key); message.content = content; connection.Write(message); }
private void SendKey(Transceiver connection, User request, string userPluginHash) { string publickey; string username; Message message = new Message(); message.creator_plugin_hash = this._hash_code; message.type = Message.Type.ServerToUser; if(request == null) { publickey = this._server_public_key; username = "******"; } else { publickey = (string)this._user_keys[request.connection]; username = request.username; } Response content = new Response(); message.content = content; content.type = BasicContent.Type.Response; content.rtype = "success"; content.AddContent("command", "publickey"); content.AddContent("username", username); content.AddContent("publickey", publickey); string mess = message.DumpMessage(); connection.Write(mess); }