瀏覽代碼

Throws an exception when strophe plugins are missing.

tags/v0.0.2
damencho 9 年之前
父節點
當前提交
0e49f7b92f
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. 4
    0
      modules/xmpp/xmpp.js

+ 4
- 0
modules/xmpp/xmpp.js 查看文件

@@ -48,6 +48,10 @@ function XMPP(options, token) {
48 48
 
49 49
     this.connection = createConnection(options.bosh, token);
50 50
 
51
+    if(!this.connection.disco || !this.connection.caps)
52
+        throw new Error(
53
+            "Missing strophe-plugins (disco and caps plugins are required)!");
54
+
51 55
     // Initialize features advertised in disco-info
52 56
     this.initFeaturesList();
53 57
 

Loading…
取消
儲存