1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Ignore all but the lastest DM from a particular user

This commit is contained in:
Jeff Mitchell
2011-02-12 23:16:53 -05:00
parent dd1002178d
commit b6cb99fa67

View File

@@ -258,8 +258,21 @@ TwitterPlugin::directMessages( const QList< QTweetDMStatus > &messages )
qDebug() << Q_FUNC_INFO;
bool peersChanged = false;
QHash< QString, QTweetDMStatus > latestHash;
foreach( QTweetDMStatus status, messages )
foreach ( QTweetDMStatus status, messages )
{
if ( !latestHash.contains( status.senderScreenName() ) )
latestHash[status.senderScreenName()] = status;
else
{
if ( status.id() > latestHash[status.senderScreenName()].id() )
latestHash[status.senderScreenName()] = status;
}
}
foreach( QTweetDMStatus status, latestHash.values() )
{
qDebug() << "TwitterPlugin checking direct message from " << status.senderScreenName() << " with content " << status.text();
if ( status.id() > m_cachedDirectMessagesSinceId )