Пример #1
0
STFavoriteTimeline::STFavoriteTimeline(QString identifier, quint64 targetUserId, QObject *parent) :
    STTimeline(identifier, parent), m_targetUserId(targetUserId)
{
    QString urlStr="https://api.twitter.com/1.1/favorites/list.json?user_id=%1";
    setFetchEndpoint(QUrl(urlStr.arg(targetUserId)));

    STAccount *account=accountForIdentifier(identifier);
    if(account->userId()==targetUserId){
        m_streamer=account->userStreamer();
        connect(m_streamer, SIGNAL(streamingStarted()),
                this, SLOT(streamStarted()));
        connect(m_streamer, SIGNAL(streamingStopped(QString)),
                this, SLOT(streamStopped(QString)));
        connect(m_streamer, SIGNAL(streamingCouldNotStarted(QString)),
                this, SLOT(streamFailedToStart(QString)));
        connect(m_streamer, SIGNAL(statusRemoved(quint64)),
                this, SLOT(streamRemoved(quint64)));
        connect(m_streamer, SIGNAL(accountFavoritedStatus(STObjectManager::StatusRef,STObjectManager::UserRef)),
                this, SLOT(favoritedStatus(STObjectManager::StatusRef)));
        connect(m_streamer, SIGNAL(accountUnfavoritedStatus(STObjectManager::StatusRef,STObjectManager::UserRef)),
                this, SLOT(unfavoritedStatus(STObjectManager::StatusRef)));
    }else{
        m_streamer=NULL;
    }
}
Пример #2
0
void STFavoriteTimeline::startStream(){
    Q_ASSERT(m_streamer);

    if(m_streamer->state()==STStreamer::Streaming){
        streamStarted();
    }
}
Пример #3
0
void QRtmp::setStreamIsRunning(bool isRunning)
{
    if(isRunning ^ m_streamIsRunning)
    {
        m_streamIsRunning = isRunning;
        if(isRunning)
            emit streamStarted();
        else
            emit streamStopped();
    }
}
Пример #4
0
STHomeTimeline::STHomeTimeline(QString identifier, QObject *parent) :
    STTimeline(identifier, parent)
{
    QStringList lst=identifier.split(".");
    quint64 uid=lst[0].toULongLong();

    this->setFetchEndpoint(QUrl("https://api.twitter.com/1.1/statuses/home_timeline.json?exclude_replies=false&include_my_retweet=1"));

    STAccount *ac=STAccountsManager::sharedManager()->account(uid);
    Q_ASSERT(ac);

    m_streamer=ac->userStreamer();
    connect(m_streamer, SIGNAL(streamingStarted()),
            this, SLOT(streamStarted()));
    connect(m_streamer, SIGNAL(streamingStopped(QString)),
            this, SLOT(streamStopped(QString)));
    connect(m_streamer, SIGNAL(streamingCouldNotStarted(QString)),
            this, SLOT(streamFailedToStart(QString)));
    connect(m_streamer, SIGNAL(homeNewStatusReceived(STObjectManager::StatusRef)),
            this, SLOT(streamReceived(STObjectManager::StatusRef)));
    connect(m_streamer, SIGNAL(statusRemoved(quint64)),
            this, SLOT(streamRemoved(quint64)));
}
Пример #5
0
void STHomeTimeline::startStream(){
    if(m_streamer->state()==STStreamer::Streaming){
        streamStarted();
    }
}