Consistent 'connection' rather than 'server' in - part 2
authorDarren <darren@darrenwhitlen.com>
Sat, 10 May 2014 13:30:28 +0000 (14:30 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 10 May 2014 13:30:28 +0000 (14:30 +0100)
client/src/models/gateway.js
server/client.js

index ab80bcc58de2e9e57563d1a2be14f6b9a75ccfef..3210654df95da697340757df1f762fd80e6cc53d 100644 (file)
@@ -297,7 +297,7 @@ _kiwi.model.Gateway = function () {
             connection_id = _kiwi.app.connections.active_connection.get('connection_id');\r
 \r
         var data_buffer = {\r
-            server: connection_id,\r
+            connection_id: connection_id,\r
             data: JSON.stringify(data)\r
         };\r
         this.rpc.call('irc', data_buffer, callback);\r
index 1798b3863d84b3272d82c056a0e35204621349c2..0d27ddb7bf97e4366704a80c330ee4c3b5a5d85e 100755 (executable)
@@ -85,14 +85,14 @@ function handleClientMessage(msg, callback) {
         server;
 
     // Make sure we have a server number specified
-    if ((msg.server === null) || (typeof msg.server !== 'number')) {
+    if ((msg.connection_id === null) || (typeof msg.connection_id !== 'number')) {
         return (typeof callback === 'function') ? callback('server not specified') : undefined;
-    } else if (!this.state.irc_connections[msg.server]) {
+    } else if (!this.state.irc_connections[msg.connection_id]) {
         return (typeof callback === 'function') ? callback('not connected to server') : undefined;
     }
 
     // The server this command is directed to
-    server = this.state.irc_connections[msg.server];
+    server = this.state.irc_connections[msg.connection_id];
 
     if (typeof callback !== 'function') {
         callback = null;