Skip to content

Instantly share code, notes, and snippets.

@protocool
Created December 29, 2011 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protocool/1535541 to your computer and use it in GitHub Desktop.
Save protocool/1535541 to your computer and use it in GitHub Desktop.
Propane caveatPatchor.js snippet for a /clear command
/*
Add a /clear command to clear out the chat transcript in Propane.
Place this snippet into:
~Library/Application Support/Propane/unsupported/caveatPatchor.js
*/
Campfire.Speaker.Filters.push(
function(message) {
var match;
if (match = message.match(/^\/clear\s*$/)) {
chat.transcript.trimHistoryBy(100)
return false;
} else {
return message;
}
}
);
chat.speaker.filters = Campfire.Speaker.Filters.toArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment