Closed flowwolf closed 10 years ago
Hi flowwolf,
I don't know if you have tried used the EventManager for this, which would be the correct way of handling it but i'm afraid it's not working at the moment, I will make sure to fix it in the next update, meanwhile here is how you can use it.
in derplib/room_ch.js line 356 change
self.emit('messageDeleted', msg);
to
eventModule.emit('messageDeleted', msg, this);
And in main.js for example you can do this
DerpLib.events.on('messageDeleted', function(message, room){
console.log(room.name, message.text);
});
I hope it helps! Regards, Barry
This helped a lot! Thank you for the quick reply. I still can't find where in the code is printing to the console the message i'm speaking of, but your solution has allowed me to log the event at least. This is great! Thanks again.
-Jordan
Flowwolf if your watching these comments I will give you the code for this tomorrow after I leave school the code will consist of using the event that gives the message id and matches it to the messages in the cache for the room which will return the message I will be user the underscore.js module functions each and filter the code will be tested before it is placed here after I am done Barry will most likely clean up code that is not needed and will apply it to the next update so that this is automatically done
Hi Flowwolf,
Glad you got what you needed, the original console log can be found in room_ch.js on line 163. There is logs everything the lib writes to chatango, this will be optional later but for now offers good insight to what happens and allows easier debugging.
Regards, Barry
wait lol i retract that statement its already been done lol closing issue
right now when a message is deleted, it prints to the console "delete:2ZIyx121NQAyp1k=" or "delete: " and any other random string. I'm assuming this string is the msgid which is being deleted.
what i want to do is in the log i'm outputting, i want to take this event and write it to the log as well, matching it to the correct message the delete request is for. I am unable to find where in the code that the console.log command for this message is happening, or a message id to match to my log either.
could you offer me any insight to this issue? for now i'll just save the raw log with no deletion recordings. thanks for your help.