Created
July 24, 2014 16:29
-
-
Save JoeRobich/1787e17acfc5a0e64835 to your computer and use it in GitHub Desktop.
This is a GreaseMonkey script that fixes HipChat's annoying behavior of breaking up multiple consecutive chats into different chat blocks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HipChat append fix | |
// @namespace http://joeyrobichaud.com/ | |
// @version 0.1 | |
// @description Sending multiple messages in a row will create multiple chat blocks even though you are the sender of each of them. this fixes that. | |
// @match https://*.hipchat.com/chat | |
// @copyright 2014+, Joey Robichaud | |
// ==/UserScript== | |
window.addEventListener("load", function(e) { | |
var old_add_chat_text = chat.add_chat_text; | |
chat.add_chat_text = function(jid, text, type, args) { | |
var oldFrom; | |
if (type == "chat" && args.is_echo) | |
oldFrom = this.chats_last_from[jid]; | |
old_add_chat_text.apply(this, [jid, text, type, args]); | |
if (oldFrom) | |
this.chats_last_from[jid] = oldFrom; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment