added more precise timestamp_ms for streaming status
This commit is contained in:
parent
f04c49af74
commit
9faccceb49
|
@ -205,6 +205,9 @@ public class Status extends TwitterResponseObject implements Comparable<Status>,
|
|||
@JsonField(name = "uri")
|
||||
String uri;
|
||||
|
||||
@JsonField(name = "timestamp_ms")
|
||||
long timestampMs = -1;
|
||||
|
||||
@ParcelableNoThanks
|
||||
private transient long sortId = -1;
|
||||
|
||||
|
@ -265,6 +268,9 @@ public class Status extends TwitterResponseObject implements Comparable<Status>,
|
|||
* UTC time when this Tweet was created.
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
if (timestampMs != -1) {
|
||||
return new Date(timestampMs);
|
||||
}
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
|
|
@ -321,11 +321,6 @@ class StreamingService : BaseService() {
|
|||
return true
|
||||
}
|
||||
|
||||
override fun onException(ex: Throwable): Boolean {
|
||||
DebugLog.w(LOGTAG, msg = "Exception for ${account.key}", tr = ex)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onStatusDeleted(event: DeletionEvent): Boolean {
|
||||
val deleteWhere = Expression.and(Expression.likeRaw(Columns.Column(Statuses.ACCOUNT_KEY), "'%@'||?"),
|
||||
Expression.equalsArgs(Columns.Column(Statuses.STATUS_ID))).sql
|
||||
|
@ -339,6 +334,11 @@ class StreamingService : BaseService() {
|
|||
return true
|
||||
}
|
||||
|
||||
override fun onException(ex: Throwable): Boolean {
|
||||
DebugLog.w(LOGTAG, msg = "Exception for ${account.key}", tr = ex)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onUnhandledEvent(obj: TwitterStreamObject, json: String) {
|
||||
DebugLog.d(LOGTAG, msg = "Unhandled event ${obj.determine()} for ${account.key}: $json")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue