Permalink
Browse files

display chatter's name

  • Loading branch information...
1 parent 786c6bf commit ffb94bcca2149678c2d00c3978acf197f4fc9edd @miyagawa committed Oct 19, 2009
Showing with 7 additions and 1 deletion.
  1. +1 −1 eg/demo.pl
  2. +6 −0 eg/templates/chat.html
View
@@ -185,7 +185,7 @@ package main;
return unless $tweet->{user}{screen_name};
Tatsumaki::MessageQueue->instance($channel)->publish({
type => "message", address => 'twitter.com', time => scalar localtime,
- name => $tweet->{user}{screen_name},
+ name => $tweet->{user}{name},
avatar => $tweet->{user}{profile_image_url},
html => ChatPostHandler->format_message($tweet->{text}), # FIXME
ident => "http://twitter.com/$tweet->{user}{screen_name}/status/$tweet->{id}",
@@ -47,6 +47,9 @@
if (e.text) message.text(e.text);
if (e.html) message.html(e.html);
message.find('a').oembed();
+ var name = e.name || (e.ident ? e.ident.split('@')[0] : null);
+ if (name)
+ message.prepend($('<span/>').addClass('name').text(name+ ': '));
var meta = $('<td/>').addClass('meta').text(' (' + e.time + ' from ' + e.address + ')');
$('#messages').prepend($('<tr/>').addClass('message').append(avatar).append(message).append(meta));
@@ -98,6 +101,9 @@
.chat-message {
width: 70%;
}
+.chat-message .name {
+ font-weight: bold;
+}
.meta {
vertical-align: top;
color: #888;

0 comments on commit ffb94bc

Please sign in to comment.