summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/DummyStanzaChannel.h')
-rw-r--r--Swiften/Client/DummyStanzaChannel.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/Client/DummyStanzaChannel.h b/Swiften/Client/DummyStanzaChannel.h
index d43d68a..05066a8 100644
--- a/Swiften/Client/DummyStanzaChannel.h
+++ b/Swiften/Client/DummyStanzaChannel.h
@@ -11,16 +11,21 @@
11#include "Swiften/Client/StanzaChannel.h" 11#include "Swiften/Client/StanzaChannel.h"
12 12
13namespace Swift { 13namespace Swift {
14 class DummyStanzaChannel : public StanzaChannel { 14 class DummyStanzaChannel : public StanzaChannel {
15 public: 15 public:
16 DummyStanzaChannel() {} 16 DummyStanzaChannel() : available_(true) {}
17 17
18 virtual void sendStanza(boost::shared_ptr<Stanza> stanza) { 18 virtual void sendStanza(boost::shared_ptr<Stanza> stanza) {
19 sentStanzas.push_back(stanza); 19 sentStanzas.push_back(stanza);
20 } 20 }
21 21
22 void setAvailable(bool available) {
23 available_ = available;
24 onAvailableChanged(available);
25 }
26
22 virtual void sendIQ(boost::shared_ptr<IQ> iq) { 27 virtual void sendIQ(boost::shared_ptr<IQ> iq) {
23 sentStanzas.push_back(iq); 28 sentStanzas.push_back(iq);
24 } 29 }
25 30
26 virtual void sendMessage(boost::shared_ptr<Message> message) { 31 virtual void sendMessage(boost::shared_ptr<Message> message) {
@@ -34,11 +39,11 @@ namespace Swift {
34 virtual String getNewIQID() { 39 virtual String getNewIQID() {
35 return "test-id"; 40 return "test-id";
36 } 41 }
37 42
38 virtual bool isAvailable() { 43 virtual bool isAvailable() {
39 return true; 44 return available_;
40 } 45 }
41 46
42 virtual bool getStreamManagementEnabled() const { 47 virtual bool getStreamManagementEnabled() const {
43 return false; 48 return false;
44 } 49 }
@@ -47,7 +52,8 @@ namespace Swift {
47 boost::shared_ptr<IQ> iqStanza = boost::dynamic_pointer_cast<IQ>(sentStanzas[index]); 52 boost::shared_ptr<IQ> iqStanza = boost::dynamic_pointer_cast<IQ>(sentStanzas[index]);
48 return iqStanza && iqStanza->getType() == type && iqStanza->getTo() == jid && iqStanza->getPayload<T>(); 53 return iqStanza && iqStanza->getType() == type && iqStanza->getTo() == jid && iqStanza->getPayload<T>();
49 } 54 }
50 55
51 std::vector<boost::shared_ptr<Stanza> > sentStanzas; 56 std::vector<boost::shared_ptr<Stanza> > sentStanzas;
57 bool available_;
52 }; 58 };
53} 59}