Class: Watobo::Gui::TokenSettings

Inherits:
FXHorizontalFrame
  • Object
show all
Includes:
Utils
Defined in:
lib/watobo/gui/csrf_token_dialog.rb

Defined Under Namespace

Classes: SidPreview

Instance Method Summary collapse

Methods included from Utils

#addDecoder, #addEncoder, #addStringInfo, #cleanupHTTP, load_plugins, #removeTags, #replace_text

Instance Method Details

#getTokenPatternsObject



87
88
89
90
91
92
93
# File 'lib/watobo/gui/csrf_token_dialog.rb', line 87

def getTokenPatterns()
  sids = []
  @pattern_list.numItems.times do |index|
    sids.push @pattern_list.getItemData(index)
  end
  return sids
end

#updateRequests(req_id_list) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/watobo/gui/csrf_token_dialog.rb', line 95

def updateRequests(req_id_list)        
    @requestCombo.clearItems()

    req_id_list.each do |id|
      chat = Watobo::Chats.get_by_id(id)
      text = "[#{id}] #{chat.request.first}"
      @requestCombo.appendItem(text.slice(0..60), chat)
    end

    unless @target_chat.nil?
      text = "[TARGET #{@target_chat.id}] - #{@target_chat.request.first}"
      @requestCombo.appendItem(text.slice(0..60), @target_chat)
    end

    if @requestCombo.numItems > 0 then
      if @requestCombo.numItems < 10 then
        @requestCombo.numVisible = @requestCombo.numItems
      else
        @requestCombo.numVisible = 10
      end

      @requestCombo.setCurrentItem(0, true)
      chat = @requestCombo.getItemData(0)
      @request_viewer.setText(cleanupHTTP(chat.request))
      @response_viewer.setText(cleanupHTTP(chat.response))
    end
  
end