added loading and saving of irc servers

This commit is contained in:
fourtf
2019-09-10 23:55:43 +02:00
parent 0219cb0c36
commit c4d0efacff
10 changed files with 292 additions and 80 deletions
+13 -5
View File
@@ -10,21 +10,21 @@ class QAbstractTableModel;
namespace chatterino {
//enum IrcAuthType { Anonymous, /*Sals,*/ Pass, MsgNickServ, NickServ };
struct IrcConnection_ {
QString host;
int port;
bool ssl;
int port = 6667;
bool ssl = false;
QString user;
QString nick;
QString real;
// IrcAuthType authType = Anonymous;
QString password;
int id;
// makes an IrcConnection with a unique id
static IrcConnection_ unique();
};
class Irc
@@ -39,10 +39,18 @@ public:
ChannelPtr getOrAddChannel(int serverId, QString name);
void save();
void load();
int uniqueId();
signals:
void connectionUpdated(int id);
private:
int currentId_{};
bool loaded_{};
// Servers have a unique id.
// When a server gets changed it gets removed and then added again.
// So we store the channels of that server in abandonedChannels_ temporarily.