X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fnetwork.h;h=55e953aca221a13408e21d531c78d4315c80150a;hp=5b24fbf37c8a3d4d94db2870a74cdc381d33f06e;hb=91e19c05228aaba95ef27b580b35fc6ed2af7517;hpb=76db8cdfbeffaaba359c8e80cf2146da9e9e7f8a diff --git a/src/common/network.h b/src/common/network.h index 5b24fbf3..55e953ac 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,30 +50,30 @@ class Network : public SyncableObject Q_OBJECT Q_ENUMS(ConnectionState) - Q_PROPERTY(QString networkName READ networkName WRITE setNetworkName STORED false) - Q_PROPERTY(QString currentServer READ currentServer WRITE setCurrentServer STORED false) - Q_PROPERTY(QString myNick READ myNick WRITE setMyNick STORED false) - Q_PROPERTY(int latency READ latency WRITE setLatency STORED false) - Q_PROPERTY(QByteArray codecForServer READ codecForServer WRITE setCodecForServer STORED false) - Q_PROPERTY(QByteArray codecForEncoding READ codecForEncoding WRITE setCodecForEncoding STORED false) - Q_PROPERTY(QByteArray codecForDecoding READ codecForDecoding WRITE setCodecForDecoding STORED false) - Q_PROPERTY(IdentityId identityId READ identity WRITE setIdentity STORED false) - Q_PROPERTY(bool isConnected READ isConnected WRITE setConnected STORED false) - //Q_PROPERTY(Network::ConnectionState connectionState READ connectionState WRITE setConnectionState STORED false) - Q_PROPERTY(int connectionState READ connectionState WRITE setConnectionState STORED false) - Q_PROPERTY(bool useRandomServer READ useRandomServer WRITE setUseRandomServer STORED false) - Q_PROPERTY(QStringList perform READ perform WRITE setPerform STORED false) - Q_PROPERTY(bool useAutoIdentify READ useAutoIdentify WRITE setUseAutoIdentify STORED false) - Q_PROPERTY(QString autoIdentifyService READ autoIdentifyService WRITE setAutoIdentifyService STORED false) - Q_PROPERTY(QString autoIdentifyPassword READ autoIdentifyPassword WRITE setAutoIdentifyPassword STORED false) - Q_PROPERTY(bool useSasl READ useSasl WRITE setUseSasl STORED false) - Q_PROPERTY(QString saslAccount READ saslAccount WRITE setSaslAccount STORED false) - Q_PROPERTY(QString saslPassword READ saslPassword WRITE setSaslPassword STORED false) - Q_PROPERTY(bool useAutoReconnect READ useAutoReconnect WRITE setUseAutoReconnect STORED false) - Q_PROPERTY(quint32 autoReconnectInterval READ autoReconnectInterval WRITE setAutoReconnectInterval STORED false) - Q_PROPERTY(quint16 autoReconnectRetries READ autoReconnectRetries WRITE setAutoReconnectRetries STORED false) - Q_PROPERTY(bool unlimitedReconnectRetries READ unlimitedReconnectRetries WRITE setUnlimitedReconnectRetries STORED false) - Q_PROPERTY(bool rejoinChannels READ rejoinChannels WRITE setRejoinChannels STORED false) + Q_PROPERTY(QString networkName READ networkName WRITE setNetworkName) + Q_PROPERTY(QString currentServer READ currentServer WRITE setCurrentServer) + Q_PROPERTY(QString myNick READ myNick WRITE setMyNick) + Q_PROPERTY(int latency READ latency WRITE setLatency) + Q_PROPERTY(QByteArray codecForServer READ codecForServer WRITE setCodecForServer) + Q_PROPERTY(QByteArray codecForEncoding READ codecForEncoding WRITE setCodecForEncoding) + Q_PROPERTY(QByteArray codecForDecoding READ codecForDecoding WRITE setCodecForDecoding) + Q_PROPERTY(IdentityId identityId READ identity WRITE setIdentity) + Q_PROPERTY(bool isConnected READ isConnected WRITE setConnected) + //Q_PROPERTY(Network::ConnectionState connectionState READ connectionState WRITE setConnectionState) + Q_PROPERTY(int connectionState READ connectionState WRITE setConnectionState) + Q_PROPERTY(bool useRandomServer READ useRandomServer WRITE setUseRandomServer) + Q_PROPERTY(QStringList perform READ perform WRITE setPerform) + Q_PROPERTY(bool useAutoIdentify READ useAutoIdentify WRITE setUseAutoIdentify) + Q_PROPERTY(QString autoIdentifyService READ autoIdentifyService WRITE setAutoIdentifyService) + Q_PROPERTY(QString autoIdentifyPassword READ autoIdentifyPassword WRITE setAutoIdentifyPassword) + Q_PROPERTY(bool useSasl READ useSasl WRITE setUseSasl) + Q_PROPERTY(QString saslAccount READ saslAccount WRITE setSaslAccount) + Q_PROPERTY(QString saslPassword READ saslPassword WRITE setSaslPassword) + Q_PROPERTY(bool useAutoReconnect READ useAutoReconnect WRITE setUseAutoReconnect) + Q_PROPERTY(quint32 autoReconnectInterval READ autoReconnectInterval WRITE setAutoReconnectInterval) + Q_PROPERTY(quint16 autoReconnectRetries READ autoReconnectRetries WRITE setAutoReconnectRetries) + Q_PROPERTY(bool unlimitedReconnectRetries READ unlimitedReconnectRetries WRITE setUnlimitedReconnectRetries) + Q_PROPERTY(bool rejoinChannels READ rejoinChannels WRITE setRejoinChannels) public : enum ConnectionState { @@ -132,6 +132,18 @@ public : bool isChannelName(const QString &channelname) const; + /** + * Checks if the target counts as a STATUSMSG + * + * Status messages are prefixed with one or more characters from the server-provided STATUSMSG + * if available, otherwise "@" and "+" are assumed. Generally, status messages sent to a + * channel are only visible to those with the same or higher permissions, e.g. voiced. + * + * @param[in] target Name of destination, e.g. a channel or query + * @returns True if a STATUSMSG, otherwise false + */ + bool isStatusMsg(const QString &target) const; + inline bool isConnected() const { return _connected; } //Network::ConnectionState connectionState() const; inline int connectionState() const { return _connectionState; } @@ -213,10 +225,6 @@ public : inline bool autoAwayActive() const { return _autoAwayActive; } inline void setAutoAwayActive(bool active) { _autoAwayActive = active; } - static QStringList presetNetworks(bool onlyDefault = false); - static QStringList presetDefaultChannels(const QString &networkName); - static NetworkInfo networkInfoFromPreset(const QString &networkName); - public slots: void setNetworkName(const QString &networkName); void setCurrentServer(const QString ¤tServer); @@ -261,6 +269,12 @@ public slots: inline void initSetServerList(const QVariantList &serverList) { _serverList = fromVariantList(serverList); } virtual void initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels); + /** + * Update IrcUser hostmask and username from mask, creating an IrcUser if one does not exist. + * + * @param[in] mask Full nick!user@hostmask string + * @return IrcUser of the matching nick if exists, otherwise a new IrcUser + */ IrcUser *updateNickFromMask(const QString &mask); // these slots are to keep the hashlists of all users and the @@ -372,8 +386,6 @@ private: bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output - static QString _networksIniPath; - friend class IrcUser; friend class IrcChannel; };