Browse Source

Twitter plugin now uses real timestamps for messages

Change-Id: I26ed65823ded1bdc0b886df5b0a0bc0c4885ff3b
Reviewed-on: http://gerrit.dmdirc.com/1210
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
5cf9115cfe
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      src/com/dmdirc/addons/parser_twitter/Twitter.java

+ 6
- 4
src/com/dmdirc/addons/parser_twitter/Twitter.java View File

76
 import java.util.Calendar;
76
 import java.util.Calendar;
77
 import java.util.Collection;
77
 import java.util.Collection;
78
 import java.util.Collections;
78
 import java.util.Collections;
79
+import java.util.Date;
79
 import java.util.HashMap;
80
 import java.util.HashMap;
80
 import java.util.List;
81
 import java.util.List;
81
 import java.util.Map;
82
 import java.util.Map;
808
      * @param hostname Hostname that the message is from.
809
      * @param hostname Hostname that the message is from.
809
      */
810
      */
810
     private void sendChannelMessage(final ChannelInfo channel, final String message, final String hostname) {
811
     private void sendChannelMessage(final ChannelInfo channel, final String message, final String hostname) {
811
-        sendChannelMessage(channel, message, null, hostname);
812
+        sendChannelMessage(channel, new Date(), message, null, hostname);
812
     }
813
     }
813
 
814
 
814
     /**
815
     /**
815
      * Send a message to the given channel.
816
      * Send a message to the given channel.
816
      *
817
      *
817
      * @param channel Channel to send message to
818
      * @param channel Channel to send message to
819
+     * @param date The timestamp to be used for the message
818
      * @param message Message to send.
820
      * @param message Message to send.
819
      * @param cci Channel Client to send from
821
      * @param cci Channel Client to send from
820
      * @param hostname Hostname that the message is from.
822
      * @param hostname Hostname that the message is from.
821
      */
823
      */
822
-    private void sendChannelMessage(final ChannelInfo channel, final String message, final ChannelClientInfo cci, final String hostname) {
823
-        getCallbackManager().getCallbackType(ChannelMessageListener.class).call(channel, cci, message, hostname);
824
+    private void sendChannelMessage(final ChannelInfo channel, final Date date, final String message, final ChannelClientInfo cci, final String hostname) {
825
+        getCallbackManager().getCallbackType(ChannelMessageListener.class).call(date, channel, cci, message, hostname);
824
     }
826
     }
825
 
827
 
826
     /**
828
     /**
1047
                     }
1049
                     }
1048
                     
1050
                     
1049
                     final String hostname = status.getUser().getScreenName();
1051
                     final String hostname = status.getUser().getScreenName();
1050
-                    sendChannelMessage(channel, message, cci, hostname);
1052
+                    sendChannelMessage(channel, new Date(status.getTime()), message, cci, hostname);
1051
                 }
1053
                 }
1052
 
1054
 
1053
                 final List<TwitterMessage> directMessages = new ArrayList<TwitterMessage>();
1055
                 final List<TwitterMessage> directMessages = new ArrayList<TwitterMessage>();

Loading…
Cancel
Save