3
blmlimitstask - Get the BLM service limits
5
Copyright (c) 2004 Matt Rogers <mattr@kde.org>
7
Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
9
*************************************************************************
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU Lesser General Public *
13
* License as published by the Free Software Foundation; either *
14
* version 2 of the License, or (at your option) any later version. *
16
*************************************************************************
19
#include "blmlimitstask.h"
21
#include "connection.h"
23
#include "oscartypes.h"
24
#include "oscarutils.h"
26
BLMLimitsTask::BLMLimitsTask( Task* parent )
32
BLMLimitsTask::~BLMLimitsTask()
37
bool BLMLimitsTask::forMe(const Transfer* transfer) const
39
const SnacTransfer* st = dynamic_cast<const SnacTransfer*>( transfer );
44
if ( st->snacService() == 3 && st->snacSubtype() == 3 )
50
bool BLMLimitsTask::take(Transfer* transfer)
52
if ( forMe( transfer ) )
54
Buffer* buffer = transfer->buffer();
55
while ( buffer->bytesAvailable() != 0 )
57
TLV t = buffer->getTLV();
61
kDebug(OSCAR_RAW_DEBUG) << "Max BLM entries: " << t.data.toHex();
64
kDebug( OSCAR_RAW_DEBUG ) << "Max watcher entries: " << t.data.toHex();
67
kDebug( OSCAR_RAW_DEBUG ) << "Max online notifications(?): " << t.data.toHex();
71
setSuccess( 0, QString() );
78
void BLMLimitsTask::onGo()
80
kDebug(OSCAR_RAW_DEBUG) << "Sending BLM limits request";
81
FLAP f = { 0x02, 0, 0 };
82
SNAC s = { 0x0003, 0x0002, 0x0000, client()->snacSequence() };
84
Buffer* buffer = new Buffer();
85
buffer->addTLV16( 0x0005, 0x0003 );
87
Transfer *t = createTransfer( f, s, buffer );
91
//kate: tab-width 4; indent-mode csands;