Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
5cf9115cfe
1 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 6
    4
      src/com/dmdirc/addons/parser_twitter/Twitter.java

+ 6
- 4
src/com/dmdirc/addons/parser_twitter/Twitter.java Parādīt failu

@@ -76,6 +76,7 @@ import java.util.ArrayList;
76 76
 import java.util.Calendar;
77 77
 import java.util.Collection;
78 78
 import java.util.Collections;
79
+import java.util.Date;
79 80
 import java.util.HashMap;
80 81
 import java.util.List;
81 82
 import java.util.Map;
@@ -808,19 +809,20 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
808 809
      * @param hostname Hostname that the message is from.
809 810
      */
810 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 816
      * Send a message to the given channel.
816 817
      *
817 818
      * @param channel Channel to send message to
819
+     * @param date The timestamp to be used for the message
818 820
      * @param message Message to send.
819 821
      * @param cci Channel Client to send from
820 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,7 +1049,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1047 1049
                     }
1048 1050
                     
1049 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 1055
                 final List<TwitterMessage> directMessages = new ArrayList<TwitterMessage>();

Notiek ielāde…
Atcelt
Saglabāt