Skip to content

Commit

Permalink
Merge pull request #255 from SockDrawer/v2.11.3-emergency
Browse files Browse the repository at this point in the history
Fix message processing
  • Loading branch information
AccaliaDeElementia committed Sep 12, 2015
2 parents 81870a8 + 5802a43 commit 61c4cf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function handleMessages(messages) {
privateFns.processPosts(postMessages, next);
}], (_, finalMessages) => {
finalMessages.forEach(message => {
const handled = internals.events.emit('topic#' + message.topic.topic_id,
const handled = internals.events.emit('topic#' + message.topic.id,
message.data, message.topic, message.post);
if (!handled) {
internals.events.emit('logWarning', 'Message ' + message.message_id + ' for channel ' +
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sockbot",
"version": "2.11.2",
"version": "2.11.3",
"releaseName": "Cheery Chiffon",
"description": "A sockpuppet bot to use on http://what.thedailywtf.com.",
"repository": "https://github.com/SockDrawer/SockBot",
Expand Down
4 changes: 2 additions & 2 deletions test/lib/messagesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1369,13 +1369,13 @@ describe('messages', () => {
const message = {
post: Math.random(),
topic: {
'topic_id': Math.random()
id: Math.random()
},
data: Math.random()
};
emit.returns(true);
finalStep(null, [message]);
emit.calledWith('topic#' + message.topic.topic_id,
emit.calledWith('topic#' + message.topic.id,
message.data, message.topic, message.post).should.equal(true);
});
it('should emit warning for unhandled message', () => {
Expand Down

0 comments on commit 61c4cf1

Please sign in to comment.