aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2011-03-26 02:03:00 +0900
committeranekos2011-03-26 02:03:00 +0900
commit3837a15173e93156940c278ac40763a6a26cca63 (patch)
tree5e7c8e7e622687b628957ffe93cb44dc7ed3e980
parent45c17c90e18bac88b0f6eca3c1317cbdd5384dcd (diff)
downloadvimperator-plugins-3837a15173e93156940c278ac40763a6a26cca63.tar.bz2
ユーザも名前もあるんだよ
-rw-r--r--twittperator/sstp.tw9
1 files changed, 6 insertions, 3 deletions
diff --git a/twittperator/sstp.tw b/twittperator/sstp.tw
index 63bc392..d00afa1 100644
--- a/twittperator/sstp.tw
+++ b/twittperator/sstp.tw
@@ -54,7 +54,7 @@ let INFO =
let (svc = stsvc.getService())
svc.QueryInterface(Components.interfaces["nsISocketTransportService"]);
- function talk (msg) {
+ function talk (name, msg) {
let transport = socketService.createTransport(null, 0, '127.0.0.1', 9801, null);
let outputStream = transport.openOutputStream(0, 0, 0);
let conv = Cc['@mozilla.org/intl/converter-output-stream;1'].
@@ -66,7 +66,7 @@ let INFO =
"SEND SSTP/1.1",
"Sender: Twittperator",
"Charset: UTF-8",
- "Script: \\h\\s0" + msg + "\\e",
+ "Script: \\h\\s0" + name + "\\n\\n" + msg + "\\e",
"Options: nodescript,notranslate",
"Charset: UTF-8",
"",
@@ -78,7 +78,10 @@ let INFO =
outputStream.close();
}
- plugins.twittperator.ChirpUserStream.addListener(function (msg, raw) (msg.text && talk(msg.text)));
+ plugins.twittperator.ChirpUserStream.addListener(
+ function (msg, raw)
+ (msg.text && msg.user && msg.user.screen_name && talk(msg.user.screen_name, msg.text))
+ );
})();