プロジェクト

全般

プロフィール

致命的 #643 » dm.patch

Osamu Koga, 2014-03-17 01:58

差分を表示:

core/plugin/direct_message/direct_message.rb
114 114
        detach(:direct_message, event)
115 115
      }
116 116
      mumbles = ::Gtk::VBox.new(false, 0)
117
      postbox = ::Gtk::PostBox.new(Sender.new(::Gtk::PostBox::PostToPrimaryService.new, user), :postboxstorage => mumbles, :delegate_other => true)
117
      postbox = ::Gtk::PostBox.new(Sender.new(user), :postboxstorage => mumbles, :delegate_other => true)
118 118
      mumbles.pack_start(postbox)
119 119
      container.closeup(mumbles).add(::Gtk::HBox.new.add(tl).closeup(scrollbar))
120 120
      container
core/plugin/direct_message/sender.rb
2 2

  
3 3
module Plugin::DirectMessage
4 4
  class Sender
5
    attr_reader :service
6

  
7
    def initialize(service, user)
8
      @service, @user = service, user
5
    def initialize(user)
6
      @user = user
9 7
    end
10 8

  
11 9
    def post(args)
12
      @service.send_direct_message({:text => args[:message], :user => @user}, &Proc.new)
10
      Service.primary.send_direct_message({:text => args[:message], :user => @user}, &Proc.new)
13 11
    end
14 12
  end
15 13

  
    (1-1/1)