0
抱歉打擾任何人,但我真的需要這種幫助,我想從數據庫中檢索聊天(我之前已經問這個問題),但我嘗試使用Google和讀取所有文檔,我認爲我已經找到了解決辦法,我讀了converse.js文檔中關於開發者API,在歸檔組部分,我得到這個:無法讀取屬性「getUniqueId」的未定義
require(['converse'], function (converse) {
converse.plugins.add('myplugin', {
initialize: function() {
this._converse.api.archive.query({'with': '[email protected]'});
}
});
converse.initialize({
jid: '[email protected]',
authentication: 'prebind',
prebind_url: 'bind/bind.php',
allow_logout: false,
debug : true,
whitelisted_plugins: ['converse-inverse','converese-mam','converse-singleton','converse-muc-embedded','myplugin'],
archived_messages_page_size : 20,
message_archiving : "always",
auto_list_rooms: false,
show_chatstate_notifications:true,
message_carbons : true,
sounds_path : "sounds/",
auto_reconnect : true,
use_vcard : true,
auto_subscribe: false,
keepalive : true,
show_send_button:true,
archived_messages_page_size : 20,
bosh_service_url: 'http://localhost:5280/http-bind',
hide_muc_server: false,
play_sounds : true,
show_controlbox_by_default: false,
xhr_user_search: false
});
});
我嘗試,但我得到這個錯誤:
Cannot read property 'getUniqueId' of undefined
at Object._converse.queryForArchivedMessages (converse-mam.js:266)
at Object.initialize (dev.html:30)
at PluginSocket.initializePlugin (pluggable.js:196)
at arrayEach (lodash.js:537)
at Object.forEach (lodash.js:9359)
at PluginSocket.initializePlugins (pluggable.js:227)
at Object.initPlugins (converse-core.js:1854)
at Object._converse.initialize (converse-core.js:1875)
at Object.initialize (converse-core.js:2037)
at dev.html:36
我很抱歉,如果這個問題有點簡單或愚蠢,但我真的很新的使用converse.js,我真的很喜歡在未來使用和學習更多關於converse.js,因爲它具有完整的功能和文檔。
謝謝jc,我得到了mam的問題,只是發現我的xmpp服務器不支持urn:xmpp:mam:2,所以它'無法從數據庫中取回數據 – Prem