This file is indexed.

/usr/include/jreen-qt4/jreen/client.h is in libjreen-dev 1.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/****************************************************************************
**
** Jreen
**
** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
** Copyright © 2011 Aleksey Sidorov <gorthauer87@yandex.ru>
**
*****************************************************************************
**
** $JREEN_BEGIN_LICENSE$
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program.  If not, see http://www.gnu.org/licenses/.
** $JREEN_END_LICENSE$
**
****************************************************************************/

#ifndef JREEN_CLIENT_H
#define JREEN_CLIENT_H

#include <QObject>
#include <QSet>
#include "jreen.h"
#include "presence.h"
#include "disco.h"

class JREEN_AUTOTEST_EXPORT QNetworkProxyFactory;
class QNetworkProxy;

namespace Jreen
{

class ClientPrivate;
class JID;
class Message;
class IQ;
class IQReply;
class Connection;
class StreamFeature;
class Disco;
class MessageSessionManager;
class AbstractRoster;
class JingleManager;

class XmlStreamHandler
{
public:
	virtual ~XmlStreamHandler() {}
	
	virtual void handleStreamBegin() = 0;
	virtual void handleStreamEnd() = 0;
	virtual void handleIncomingData(const char *data, qint64 size) = 0;
	virtual void handleOutgoingData(const char *data, qint64 size) = 0;
};

class JREEN_EXPORT Client : public QObject
{
	Q_OBJECT
	Q_PROPERTY(QSet<QString> serverFeatures READ serverFeatures NOTIFY serverFeaturesReceived)
	Q_PROPERTY(Jreen::Disco::IdentityList serverIdentities READ serverIdentities NOTIFY serverIdentitiesReceived)
	Q_ENUMS(DisconnectReason Feature FeatureConfig)
	Q_DECLARE_PRIVATE(Client)
public:

	enum DisconnectReason
	{
		User,
		HostUnknown,
		ItemNotFound,
		AuthorizationError,
		RemoteStreamError,
		RemoteConnectionFailed,
		InternalServerError,
		SystemShutdown,
		Conflict,
		Unknown,
		NoCompressionSupport,
		NoEncryptionSupport,
		NoAuthorizationSupport,
		NoSupportedFeature
	};

	enum Feature {
		InvalidFeature = -1,
		Compression = 0,
		Encryption,
		Authorization
	};

	enum FeatureConfig {
		Force,
		Disable,
		Auto
	};

	Client(const JID &jid, const QString &password = QString(), int port = -1);
	Client();
	virtual ~Client();
	void setPingInterval(int interval);
	const JID &jid();
	void setJID(const JID &jid);
	void setPassword(const QString &password);
	void setServer(const QString &server);
	void setResource(const QString &resource);
	void setPort(int port);
	void setProxy(const QNetworkProxy &proxy);
	void setFeatureConfig(Feature feature, FeatureConfig config);
	FeatureConfig featureConfig(Feature feature) const;
	bool isFeatureActivated(Feature feature) const;
	QNetworkProxy proxy() const;
	void setProxyFactory(QNetworkProxyFactory *factory);
	QNetworkProxyFactory *proxyFactory() const;
	void addXmlStreamHandler(XmlStreamHandler *handler);
	QSet<QString> serverFeatures() const;
	Disco::IdentityList serverIdentities() const;
	const QString &server() const;
	int port() const;
	QString password() const;
	const QString getID();
	Presence &presence();
	Disco *disco();
	MessageSessionManager *messageSessionManager();
	AbstractRoster *roster();
	JingleManager *jingleManager();
	bool isConnected() const;
	void send(const Stanza &stanza);
	void send(const Presence &pres);
	IQReply *send(const IQ &iq);
	/* Q_DECL_DEPRECATED */ void send(const IQ &iq, QObject *handler, const char *member, int context);
	void setConnection(Connection *conn);
	Connection *connection() const;
	void registerPayload(AbstractPayloadFactory *factory);
	void registerStreamFeature(StreamFeature *streamFeature);
	void removeStreamFeature(StreamFeature *streamFeature);
public slots:
	void setPresence();
	void setPresence(Jreen::Presence::Type type, const QString &text = QString(), int priority = -129);
	void connectToServer();
	void disconnectFromServer(bool force = false);
signals:
	void connected();
	void disconnected(Jreen::Client::DisconnectReason);
	void authorized();
	void presenceReceived(const Jreen::Presence &presence);
	void mucPresenceReceived(const Jreen::Presence &presence);
	void iqReceived(const Jreen::IQ &iq);
	void messageReceived(const Jreen::Message &message);
	void serverFeaturesReceived(const QSet<QString> &features);
	void serverIdentitiesReceived(const Jreen::Disco::IdentityList &identities) const;
protected:
	virtual void timerEvent(QTimerEvent *);
	virtual void handleConnect();
	virtual void handleDisconnect();
	virtual void handleAuthorized();
	virtual void handlePresence(const Presence &presence);
	virtual void handleIQ(const IQ &iq);
	virtual void handleMessage(const Message &message);
private:
	QScopedPointer<ClientPrivate> d_ptr;
	Q_PRIVATE_SLOT(d_func(), void _q_iq_received(const Jreen::IQ &iq, int context))
	Q_PRIVATE_SLOT(d_func(), void _q_new_data())
	Q_PRIVATE_SLOT(d_func(), void _q_read_more())
	Q_PRIVATE_SLOT(d_func(), void _q_send_header())
	Q_PRIVATE_SLOT(d_func(), void _q_connected())
	Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(Jreen::Connection::SocketState))
};

}

#endif // JREEN_CLIENT_H