jianlinwei / google-voice-java

Automatically exported from code.google.com/p/google-voice-java
0 stars 0 forks source link

SMSThread Date information inaccurate #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
SMSThread thread ...

for (SMS sms : thread.getAllSMS()) {

    DateFormat formatter;
    formatter = new SimpleDateFormat("MMM-dd HH:mm");
    System.out.println(formatter.format(sms.getDateTime()));

2. What is the expected output? What do you see instead?

 If you have recently added to an older thread, the date of the individual SMS will show as the most recent date rather that the correct date the mesages were sent

Looking at GV Website, it seems that the information simply is not available.  
Time but not dates are displayed.  We need some other means of determining the 
information...

Original issue reported on code.google.com by malone.j...@gmail.com on 3 Feb 2012 at 4:14

GoogleCodeExporter commented 9 years ago
When SMSParser.getSMSThreads() is called, and the Collection of SMSThreads is 
constructed, the following function is called:

private void addSMSsToThread(SMSThread thread, Element messages)
{
    ...

    if (!time.before(thread.getDate())) {
        time = new Date(time.getTime() - 
            86400000L);
    }

    ...
}

This if statement causes dates to be set back 24 hours. So the dates of some 
SMS messages (which we have already determined will be inaccurate due to the 
way GV displays them) are made to be even more inaccurate.

This if statement should be removed at least until we have a better way to 
determine the date/time of each individual message.

Original comment by ckolek@gmail.com on 21 Feb 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Thanks ckolek!  I will review that code and make adjustments...

Original comment by malone.j...@gmail.com on 21 Feb 2012 at 6:50