Moving server-side capContainsAny() to IrcConnection object
authorDarren <darren@darrenwhitlen.com>
Sat, 12 Jul 2014 17:31:05 +0000 (18:31 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 12 Jul 2014 17:31:05 +0000 (18:31 +0100)
server/irc/commands.js
server/irc/connection.js

index 9516718beff85f4f8625857e6c9f33f3c128a32e..d8e7096a636332dc539f0d4a105231621cf9b3e4 100644 (file)
@@ -334,20 +334,6 @@ IrcCommand.prototype.getServerTime = function() {
 
 
 
-
-
-
-
-function capContainsAny (caps) {
-    var intersection;
-    if (!caps instanceof Array) {
-        caps = [caps];
-    }
-    intersection = _.intersection(this.irc_connection.cap.enabled, caps);
-    return intersection.length > 0;
-}
-
-
 // Code based on http://anentropic.wordpress.com/2009/06/25/javascript-iso8601-parser-and-pretty-dates/#comment-154
 function parseISO8601(str) {
     if (Date.prototype.toISOString) {
index 62b5bf3031cfda75b532bb724bda833d0b10cd46..6822a5a55b9ed01df79e9db86f763bd5109ffa1e 100644 (file)
@@ -428,6 +428,22 @@ IrcConnection.prototype.end = function (data) {
 
 
 
+/**
+ * Check if any server capabilities are enabled
+ */
+IrcConnection.prototype.capContainsAny = function (caps) {
+    var enabled_caps;
+
+    if (!caps instanceof Array) {
+        caps = [caps];
+    }
+
+    enabled_caps = _.intersection(this.cap.enabled, caps);
+    return enabled_caps.length > 0;
+};
+
+
+
 /**
  * Clean up this IrcConnection instance and any sockets
  */