Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created July 26, 2012 18:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save penguin2716/3183710 to your computer and use it in GitHub Desktop.
Save penguin2716/3183710 to your computer and use it in GitHub Desktop.
鍵垢のツイート背景をグレーにするmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :gray_protected_users do
UserConfig[:protected_users_background_color] ||= [0xcccc,0xcccc,0xcccc]
filter_message_background_color do | mp, array |
if mp.to_message.user[:protected] == true
array = UserConfig[:protected_users_background_color]
end
[mp, array]
end
settings("Protected_Users_Color") do
color("鍵付きユーザの背景色",:protected_users_background_color)
end
end
@akihiro
Copy link

akihiro commented Dec 25, 2012

設定画面で背景色指定できるforkを作ってみました.よろしければマージしていただけると幸いです.
なお修正箇所のライセンスはNYSLですので煮るなり焼くなり好きにしていただければ嬉しいです.

@tsutsui
Copy link

tsutsui commented Jan 2, 2018

mikutter 3.6.0 では以下の警告が出るようです。

warning: /usr/pkg/lib/ruby/2.3.0/rubygems/deprecate.rb:62:in `block (2 levels) in deprecate': NOTE: Gdk::MiraclePainter#to_message is deprecated with no replacement. It will be removed on or after 2017-05-01.
Gdk::MiraclePainter#to_message called from /home/tsutsui/.mikutter/plugin/gray_protected_users.rb:6.

no replacement と言われてますが、とりあえず単純に to_message を message に変更すれば警告は消えて意図通り動作もするようです。
ちょくちょく使っているのでこれで更新していただけるとありがたいです。
https://gist.github.com/tsutsui/2a5063949af54b92c017ed8a72d3e2e3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment