aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtwittperator/twsidebar.tw16
1 files changed, 15 insertions, 1 deletions
diff --git a/twittperator/twsidebar.tw b/twittperator/twsidebar.tw
index 585c39a..341622f 100755
--- a/twittperator/twsidebar.tw
+++ b/twittperator/twsidebar.tw
@@ -48,7 +48,12 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () {
dontStop: true,
// サイドバーが閉じていても、こっそり開始しておく
- silentStart: false
+ silentStart: false,
+
+ // 配列かオブジェクトを返すと、変更できる。
+ modifier: function (msg, tab, streamName) {
+ return [msg, tab, streamName];
+ }
};
// 日本語判定
@@ -158,6 +163,15 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () {
function append (t, tab, streamName) {
tab = tab || 'home';
+ let modified = Config.modifier && Config.modifier(t, tab, streamName);
+ if (modified) {
+ if (modified instanceof Array) {
+ [t, tab, streamName] = modified;
+ } else {
+ t = modified;
+ }
+ }
+
let now = JSON.stringify({name: t.name, text: t.text, tab: tab});
if (latest === now) {
if (latestNode)