void StatusRootAction::changeStatus( const Kopete::Status::Status* status )
{
	Kopete::StatusMessage statusMessage;
	statusMessage.setTitle( status->title() );
	statusMessage.setMessage( status->message() );

	if ( d->account )
	{	// Set status for this account only
		if ( d->filter == UseCategory )
		{
			if ( status->category() != 0x00 )
			{
				OnlineStatusManager *osm = OnlineStatusManager::self();
				Kopete::OnlineStatus oStatus = osm->onlineStatus( d->account->protocol(), status->category() );
				d->account->setOnlineStatus( oStatus, statusMessage, Kopete::Account::KeepSpecialFlags );
			}
			else
			{
				setStatusMessage( statusMessage );
			}
		}
		else
		{
			d->account->setOnlineStatus( d->onlineStatus, statusMessage, Kopete::Account::KeepSpecialFlags );
		}
	}
	else
	{	// Set global status
		if ( status->category() != 0x00 )
			emit changeStatus( status->category(), statusMessage );
		else
			setStatusMessage( statusMessage );
	}
}
void FacebookAccount::setOnlineStatus(const Kopete::OnlineStatus& status, const Kopete::StatusMessage &reason, const OnlineStatusOptions& options)
{
    Q_UNUSED(options);

    if ( status.status() == Kopete::OnlineStatus::Online &&
         myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline )
        slotGoOnline();
    else if (status.status() == Kopete::OnlineStatus::Online &&
             myself()->onlineStatus().status() == Kopete::OnlineStatus::Away )
        setAway( false, reason.message() );
    else if ( status.status() == Kopete::OnlineStatus::Offline )
        slotGoOffline();
    else if ( status.status() == Kopete::OnlineStatus::Away )
        slotGoAway( /* reason */ );    
}
void MeanwhileSession::setStatus(Kopete::OnlineStatus status,
        const Kopete::StatusMessage &msg)
{
    HERE;
    mwDebug() << "setStatus: " << status.description() << '('
        << status.internalStatus() << ')' << endl;
    if (status.internalStatus() == 0)
        return;

    struct mwUserStatus stat;
    mwUserStatus_clone(&stat, mwSession_getUserStatus(session));

    free(stat.desc);

    stat.status = (mwStatusType)status.internalStatus();
    if (msg.isEmpty())
        stat.desc = ::strdup(status.description().toUtf8().constData());
    else
        stat.desc = ::strdup(msg.message().toUtf8().constData());

    mwSession_setUserStatus(session, &stat);
    /* will free stat.desc */
    mwUserStatus_clear(&stat);
}
Example #4
0
void IRCAccount::setOnlineStatus(const Kopete::OnlineStatus& status, const Kopete::StatusMessage &reason, const OnlineStatusOptions& /*options*/)
{
	if ( status.status() == Kopete::OnlineStatus::Online &&
			myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline )
		slotGoOnline();
	else if (status.status() == Kopete::OnlineStatus::Online &&
			(myself()->onlineStatus().status() == Kopete::OnlineStatus::Away || 
				myself()->onlineStatus().status() == Kopete::OnlineStatus::Busy) )
		setAway( false, reason.message() );
	else if ( status.status() == Kopete::OnlineStatus::Offline )
		slotGoOffline();
	else if ( status.status() == Kopete::OnlineStatus::Away )
		slotGoAway( /* reason */ );
	else if ( status.status() == Kopete::OnlineStatus::Busy )
		slotGoBusy( /* reason */ );
}
void FacebookAccount::setStatusMessage(const Kopete::StatusMessage& statusMessage)
{
        if ( ! statusMessage.isEmpty() )
            m_service->setStatusMessage(statusMessage.title());    
}