From 0d0535336507599ecefd7e33ee7d50b46d03cdd6 Mon Sep 17 00:00:00 2001 From: anekos Date: Fri, 13 Aug 2010 04:23:19 +0000 Subject: 自分のツィーツを補完に出さないように git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38254 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index af6e987..971e835 100755 --- a/twittperator.js +++ b/twittperator.js @@ -28,7 +28,7 @@ let PLUGIN_INFO = twittperator Twitter Client using ChirpStream OAuth対応Twitterクライアント - 1.1.0 + 1.1.1 2.3 2.4 teramako @@ -1557,26 +1557,31 @@ let PLUGIN_INFO = let (s = ("retweeted_status" in status) ? status.retweeted_status : status) func(s); // }}} + function rejectMine(statuses) + let (n = setting.screenName) + (n ? statuses.filter(function(st) (!st.user || st.user.screen_name !== n)) : statuses); + + const Completers = { // {{{ name: function(context, args) { context.completions = - history.map(rt(function(s) ["@" + s.user.screen_name, s])); + rejectMine(history).map(rt(function(s) ["@" + s.user.screen_name, s])); }, link: function(context, args) { context.completions = - history.map(rt(function(s) [s.text, s])).filter(function([t]) /https?:\/\//(t)); + rejectMine(history).map(rt(function(s) [s.text, s])).filter(function([t]) /https?:\/\//(t)); }, text: function(context, args) { context.completions = - history.map(rt(function(s) [s.text, s])); + rejectMine(history).map(rt(function(s) [s.text, s])); }, name_id: function(context, args) { context.completions = - history.map(rt(function(s) ["@" + s.user.screen_name + "#" + s.id, s])); + rejectMine(history).map(rt(function(s) ["@" + s.user.screen_name + "#" + s.id, s])); }, name_id_text: function(context, args) { context.completions = - history.map(rt(function(s) ["@" + s.user.screen_name + "#" + s.id + ": " + s.text, s])); + rejectMine(history).map(rt(function(s) ["@" + s.user.screen_name + "#" + s.id + ": " + s.text, s])); } }; // }}} @@ -1805,6 +1810,7 @@ let PLUGIN_INFO = showTLURLScheme: let (v = gv.twittperator_show_tl_with_https_url) ("http" + (v === false ? "" : "s")), proxyHost: gv.twittperator_proxy_host, proxyPort: gv.twittperator_proxy_port, + screenName: gv.twittperator_screen_name }); let statusRefreshTimer; -- cgit v1.2.3