@pwFoo there was a bug in a code.
Please, update plugin to the last version (0.3.6), change again the lines 60, 61 and 65 of library.js, reload, restart and test again. Sorry for the inconvenience
Hello guys,
I just must say that I love nodebb and starting to love nodejs. I primarely program in pyhton and use django , but this is good for me to learn.
I have created a fork of the original shoutbox plugin and added room support. Rooms are created on fly when you enter /chat/RoomName, RoomName could be anything .
My first test works as expected, but if I add in the custom route in navigation , like /chat/RoomName , when I click first time , the connection stalls, but if I refresh the page it loads ok , or if I enter the full url in browser it loads from first time as expected, this issue I haven`t managed to solve.
Sorry for the original name which I have not changed, I hope I will change the name in the future. I will try to solve this issue also.
The repository url is : https://github.com/claudiutraistaru/nodebb-plugin-shoutbox
router.get('/chat/:room', params.middleware.buildHeader, renderChatRoom);
router.get('/api/chat/:room', params.middleware.buildHeader, renderChatRoom);
API routes don't need the buildHeader middleware, not sure if that is causing the problem though.
The api should not get the buildHeader, or am I wrong?
This shouldn`t be?:
router.get('/chat/:room', params.middleware.buildHeader, renderChatRoom);
router.get('/api/chat/:room', renderChatRoom);
Also tried with :
router.get('/api/chat/:room',function (req,res){});
Same issue
Right now when testing on my dev system I was able to get an error in chrome:
Uncaught TypeError: Cannot read property 'name' of undefined , in nodebb.min.js, the part of code that gives error is :
ajaxify.variables.flush();
ajaxify.loadData(url, function(err, data) {
if (err) {
return onAjaxError(err, url, callback, quiet);
}
app.template = data.template.name;
require(['translator'], function(translator) {
translator.load(config.defaultLang, data.template.name);
renderTemplate(url, data.template.name, data, callback);
});
});
The line with error is : app.template = data.template.name;
On reload everything is ok as I have said, but doesn`t matter how many times I click on the shortcut or href inside nodebb the connection stalls .
@Scuzz. For the moment for it to work on 0.7 on my install I have removed the hooks for usersettings, but if I have any time soon I will try to make those work also. This at the moment was shown that maybe someone will make use of the code before I will make it stable.