プロジェクト

全般

プロフィール

バグ #1225 » userless_message.patch

topic/1219-quoted-tweetのcheckout後に当てる - cob odo, 2018-05-05 16:59

差分を表示:

core/mui/cairo_miracle_painter.rb
237 237
    textselector_unselect end
238 238

  
239 239
  def iob_icon_pixbuf
240
    [ ["reply.png".freeze, message.user.verified? ? "verified.png" : "etc.png"],
241
      [if message.user.protected?; then "protected.png".freeze else "retweet.png".freeze end,
240
    [ ["reply.png".freeze, (message.respond_to?(:user) && message.user.verified?) ? "verified.png" : "etc.png"],
241
      [if message.respond_to?(:user) && message.user.protected?; then "protected.png".freeze else "retweet.png".freeze end,
242 242
       message.favorite? ? "unfav.png".freeze : "fav.png".freeze] ] end
243 243

  
244 244
  def iob_icon_pixbuf_off
245 245
    world, = Plugin.filtering(:world_current, nil)
246 246
    [ [(UserConfig[:show_replied_icon] and message.mentioned_by_me? and "reply.png".freeze),
247
       UserConfig[:show_verified_icon] && message.user.verified? && "verified.png"],
248
      [ if UserConfig[:show_protected_icon] and message.user.protected?
247
       UserConfig[:show_verified_icon] && message.respond_to?(:user) && message.user.verified? && "verified.png"],
248
      [ if UserConfig[:show_protected_icon] and message.respond_to?(:user) and message.user.protected?
249 249
          "protected.png".freeze
250 250
        elsif Plugin[:miracle_painter].shared?(message, world)
251 251
          "retweet.png".freeze end,
......
390 390
    layout end
391 391

  
392 392
  def header_left_markup
393
    user = message.user
394
    if user.respond_to?(:idname)
395
      Pango.parse_markup("<b>#{Pango.escape(user.idname)}</b> #{Pango.escape(user.name || '')}")
393
    if message.respond_to?(:user)
394
      user = message.user
395
      if user.respond_to?(:idname)
396
        Pango.parse_markup("<b>#{Pango.escape(user.idname)}</b> #{Pango.escape(user.name || '')}")
397
      else
398
        Pango.parse_markup(Pango.escape(user.name || ''))
399
      end
396 400
    else
397
      Pango.parse_markup(Pango.escape(user.name || ''))
401
      Pango.parse_markup(Pango.escape(''))
398 402
    end
399 403
  end
400 404

  
......
434 438

  
435 439
  # アイコンのpixbufを返す
436 440
  def main_icon
437
    @main_icon ||= message.user.icon.load_pixbuf(width: icon_width, height: icon_height){|pixbuf|
441
    @main_icon ||= message.icon.load_pixbuf(width: icon_width, height: icon_height){|pixbuf|
438 442
      @main_icon = pixbuf
439 443
      on_modify
440 444
    }
core/mui/cairo_sub_parts_message_base.rb
40 40
  # [Pango::FontDescription] フォント情報
41 41
  # [Pango::Attribute] マークアップ情報
42 42
  def header_left_content(message)
43
    user = message.user
44
    if message.user[:idname]
45
      attr_list, text = Pango.parse_markup("<b>#{Pango.escape(user.idname)}</b> #{Pango.escape(user.name || '')}")
43
    if message.respond_to?(:user)
44
      user = message.user
45
      if message.user[:idname]
46
        attr_list, text = Pango.parse_markup("<b>#{Pango.escape(user.idname)}</b> #{Pango.escape(user.name || '')}")
47
      else
48
        attr_list, text = Pango.parse_markup(Pango.escape(user.name || ''))
49
      end
46 50
    else
47
      attr_list, text = Pango.parse_markup(Pango.escape(user.name || ''))
51
      attr_list, text = Pango.parse_markup(Pango.escape(''))
48 52
    end
49 53
    return text, header_left_font(message), attr_list
50 54
  end
......
445 449
      context.paint end end
446 450

  
447 451
  def main_icon(message)
448
    message.user.icon.load_pixbuf(width: icon_size.width, height: icon_size.width){ helper.on_modify }
452
    message.icon.load_pixbuf(width: icon_size.width, height: icon_size.width){ helper.on_modify }
449 453
  end
450 454

  
451 455
  # 表示する際に本文に適用すべき装飾オブジェクトを作成する
    (1-1/1)