~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/modules/serverdb/libkviserverdb.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//   File : libkviserverdb.cpp
4
4
//   Creation date : Tue Jul  1 01:48:49 2008 GMT by Elvio Basello
5
5
//
6
 
//   This file is part of the KVirc irc client distribution
 
6
//   This file is part of the KVIrc irc client distribution
7
7
//   Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)
8
8
//
9
9
//   This program is FREE software. You can redistribute it and/or
22
22
//
23
23
//=============================================================================
24
24
 
25
 
#include "kvi_module.h"
26
 
#include "kvi_app.h"
27
 
#include "kvi_locale.h"
28
 
#include "kvi_ircserver.h"
29
 
#include "kvi_ircserverdb.h"
 
25
#include "KviModule.h"
 
26
#include "KviApplication.h"
 
27
#include "KviLocale.h"
 
28
#include "KviIrcServer.h"
 
29
#include "KviIrcServerDataBase.h"
30
30
 
31
31
#include <QString>
32
32
 
33
 
extern KVIRC_API KviServerDataBase * g_pServerDataBase;
 
33
extern KVIRC_API KviIrcServerDataBase * g_pServerDataBase;
 
34
 
 
35
/*
 
36
        @doc: serverdb
 
37
        @type:
 
38
                module
 
39
        @short:
 
40
                Interface to the servers database
 
41
        @title:
 
42
                The serverdb module
 
43
        @body:
 
44
                The serverdb module is the scripting interface to the servers and networks database.[br]
 
45
                It provides the following set of commands:[br]
 
46
                [cmd]serverdb.addNetwork[/cmd]: adds a network entry to the database[br]
 
47
                [cmd]serverdb.addServer[/cmd]: adds a server entry to the database[br]
 
48
                [cmd]serverdb.setNetworkConnectCommand[/cmd]: sets a "on connect" script for the network[br]
 
49
                [cmd]serverdb.setNetworkEncoding[/cmd]: sets the network encoding[br]
 
50
                [cmd]serverdb.setNetworkTextEncoding[/cmd]: sets the network text encoding[br]
 
51
                [cmd]serverdb.setNetworkDescription[/cmd]: sets the network description[br]
 
52
                [cmd]serverdb.setNetworkLoginCommand[/cmd]: sets a "on login" script for the network[br]
 
53
                [cmd]serverdb.setNetworkNickName[/cmd]: sets the network specific nickname[br]
 
54
                [cmd]serverdb.setNetworkRealName[/cmd]: sets the network specific realname[br]
 
55
                [cmd]serverdb.setNetworkUserName[/cmd]: sets the network specific username[br]
 
56
                [cmd]serverdb.setNetworkJoinChannels[/cmd]: sets the network autojoin channels list[br]
 
57
                [cmd]serverdb.setServerConnectCommand[/cmd]: sets a "on connect" script for the server[br]
 
58
                [cmd]serverdb.setServerEncoding[/cmd]: sets the server encoding[br]
 
59
                [cmd]serverdb.setServerTextEncoding[/cmd]: sets the server text encoding[br]
 
60
                [cmd]serverdb.setServerDescription[/cmd]: sets the server description[br]
 
61
                [cmd]serverdb.setServerLoginCommand[/cmd]: sets a "on login" script for the server[br]
 
62
                [cmd]serverdb.setServerNickName[/cmd]: sets the server specific nickname[br]
 
63
                [cmd]serverdb.setServerRealName[/cmd]: sets the server specific realname[br]
 
64
                [cmd]serverdb.setServerUserName[/cmd]: sets the server specific username[br]
 
65
                [cmd]serverdb.setServerJoinChannels[/cmd]: sets the server autojoin channels list[br]
 
66
                [br]
 
67
                It provides the following set of functions:[br]
 
68
                [fnc]$serverdb.cacheIp[/fnc]: returns the cache-ip status for a server[br]
 
69
                [fnc]$serverdb.networkConnectCommand[/fnc]: returns the "on connect" script for a network[br]
 
70
                [fnc]$serverdb.networkDescription[/fnc]: returns the description for a network[br]
 
71
                [fnc]$serverdb.networkEncoding[/fnc]: returns the encoding for a network[br]
 
72
                [fnc]$serverdb.networkTextEncoding[/fnc]: returns the text encoding for a network[br]
 
73
                [fnc]$serverdb.networkLoginCommand[/fnc]: returns the "on login" script for a network[br]
 
74
                [fnc]$serverdb.networkName[/fnc]: returns the name of a network[br]
 
75
                [fnc]$serverdb.networkNickName[/fnc]: returns the specific nickname for a network[br]
 
76
                [fnc]$serverdb.networkRealName[/fnc]: returns the specific realname for a network[br]
 
77
                [fnc]$serverdb.networkUserName[/fnc]: returns the specific username for a network[br]
 
78
                [fnc]$serverdb.networkJoinChannels[/fnc]: returns the list of autojoin channels for a network[br]
 
79
                [fnc]$serverdb.serverConnectCommand[/fnc]: returns the "on connect" script for a server[br]
 
80
                [fnc]$serverdb.serverDescription[/fnc]: returns the description for a server[br]
 
81
                [fnc]$serverdb.serverEncoding[/fnc]: returns the encoding for a server[br]
 
82
                [fnc]$serverdb.serverTextEncoding[/fnc]: returns the text encoding for a server[br]
 
83
                [fnc]$serverdb.serverId[/fnc]: returns the unique id for a server[br]
 
84
                [fnc]$serverdb.serverIp[/fnc]: returns the ip for a server[br]
 
85
                [fnc]$serverdb.serverLoginCommand[/fnc]: returns the "on login" script for a server[br]
 
86
                [fnc]$serverdb.serverNickName[/fnc]: returns the specific nickname for a server[br]
 
87
                [fnc]$serverdb.serverPassword[/fnc]: returns the password for a server[br]
 
88
                [fnc]$serverdb.serverPort[/fnc]: returns the port for a server[br]
 
89
                [fnc]$serverdb.serverRealName[/fnc]: returns the specific realname for a server[br]
 
90
                [fnc]$serverdb.serverUserName[/fnc]: returns the specific username for a server[br]
 
91
                [fnc]$serverdb.serverJoinChannels[/fnc]: returns the list of autojoin channels for a server[br]
 
92
                [fnc]$serverdb.isAutoConnect[/fnc]: returns the autoconnect status for a server[br]
 
93
                [fnc]$serverdb.isIPv6[/fnc]: returns the ipv6 status for a server[br]
 
94
                [fnc]$serverdb.isSSL[/fnc]: returns the ssl status for a server[br]
 
95
                [fnc]$serverdb.networkExists[/fnc]: checks if a network exists[br]
 
96
                [fnc]$serverdb.serverExists[/fnc]: checks if a server exists[br]
 
97
*/
34
98
 
35
99
/*
36
100
        @doc: serverdb.networkExists
40
104
                $serverdb.networkExists
41
105
        @short:
42
106
                Checks if the network already exists in the DB
43
 
        @synthax:
44
 
                <bool> $serverdb.networkExists
 
107
        @syntax:
 
108
                <bool> $serverdb.networkExists(<network_name:string>)
45
109
        @description:
46
110
                Checks if the network already exists in the DB.[br]
47
 
                It returns 1 if the network exixts, 0 otherwise
 
111
                It returns 1 if the network exixts, 0 otherwise.
48
112
        @seealso:
49
113
                [module:serverdb]ServerDB module documentation[/module]
50
114
*/
62
126
                return false;
63
127
        }
64
128
 
65
 
        KviNetwork * pNetwork = g_pServerDataBase->findNetwork(szNetwork);
 
129
        KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szNetwork);
66
130
        if(!pNetwork)
67
131
        {
68
132
                c->returnValue()->setBoolean(false);
81
145
                $serverdb.serverExists
82
146
        @short:
83
147
                Checks if the network already exists in the DB
84
 
        @synthax:
85
 
                <bool> $serverdb.serverExists(<string:servername>[,<string:networkname>])
 
148
        @syntax:
 
149
                <bool> $serverdb.serverExists(<servername:string>[,<networkname:string>])
86
150
        @description:
87
151
                Checks if the server already exists for a network in the DB.[br]
88
152
                If no network name is provided, the check is made globally.[br]
108
172
        if(!szNetwork.isEmpty())
109
173
        {
110
174
                // Check in the given network
111
 
                KviNetwork * pRecord = g_pServerDataBase->findNetwork(szNetwork);
 
175
                KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetwork);
112
176
                if(!pRecord)
113
177
                {
114
178
                        c->returnValue()->setBoolean(false);
115
179
                        return true;
116
180
                }
117
181
 
118
 
                KviServer * pCheckServer = pRecord->findServer(szServer);
 
182
                KviIrcServer * pCheckServer = pRecord->findServer(szServer);
119
183
                if(!pCheckServer)
120
184
                {
121
185
                        c->returnValue()->setBoolean(false);
125
189
                c->returnValue()->setBoolean(true);
126
190
        } else {
127
191
                // Check through all networks
128
 
                KviPointerHashTableIterator<QString,KviNetwork> it(*(g_pServerDataBase->recordDict()));
 
192
                KviPointerHashTableIterator<QString,KviIrcNetwork> it(*(g_pServerDataBase->recordDict()));
129
193
 
130
 
                while(KviNetwork * r = it.current())
 
194
                while(KviIrcNetwork * r = it.current())
131
195
                {
132
 
                        KviPointerList<KviServer> * sl = r->serverList();
 
196
                        KviPointerList<KviIrcServer> * sl = r->serverList();
133
197
 
134
 
                        for(KviServer * s = sl->first(); s; s = sl->next())
 
198
                        for(KviIrcServer * s = sl->first(); s; s = sl->next())
135
199
                        {
136
200
                                if(QString::compare(s->hostName().toUtf8().data(),szServer,Qt::CaseInsensitive)==0)
137
201
                                {
148
212
        return true;
149
213
}
150
214
 
 
215
#define BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \
 
216
        static bool __functionName(KviKvsModuleFunctionCall * c) \
 
217
        { \
 
218
                QString szName; \
 
219
                \
 
220
                KVSM_PARAMETERS_BEGIN(c) \
 
221
                        KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) \
 
222
                KVSM_PARAMETERS_END(c) \
 
223
                \
 
224
                if(szName.isEmpty()) \
 
225
                { \
 
226
                        c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \
 
227
                        return false; \
 
228
                } \
 
229
                \
 
230
                KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \
 
231
                if(!pNetwork) \
 
232
                { \
 
233
                        c->error(__tr2qs_ctx("The specified network does not exist","serverdb")); \
 
234
                        return false; \
 
235
                }
 
236
 
 
237
 
 
238
#define END_SERVERDB_GET_NETWORK_PROPERTY \
 
239
                return true; \
 
240
        }
 
241
 
151
242
#define SERVERDB_GET_NETWORK_PROPERTY(__functionName,__callName) \
152
 
        static bool __functionName(KviKvsModuleFunctionCall * c) \
153
 
        { \
154
 
                QString szName; \
155
 
                \
156
 
                KVSM_PARAMETERS_BEGIN(c) \
157
 
                        KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) \
158
 
                KVSM_PARAMETERS_END(c) \
159
 
                \
160
 
                if(szName.isEmpty()) \
161
 
                { \
162
 
                        c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \
163
 
                        return false; \
164
 
                } \
165
 
                \
166
 
                KviNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \
167
 
                if(!pNetwork) \
168
 
                { \
169
 
                        c->error(__tr2qs_ctx("The specified network does not exist","serverdb")); \
170
 
                        return false; \
171
 
                } \
 
243
        BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \
172
244
                \
173
245
                c->returnValue()->setString(pNetwork->__callName()); \
174
246
                \
 
247
        END_SERVERDB_GET_NETWORK_PROPERTY
 
248
 
 
249
#define BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \
 
250
        static bool __functionName(KviKvsModuleFunctionCall * c) \
 
251
        { \
 
252
                QString szNetName, szServName; \
 
253
                \
 
254
                KVSM_PARAMETERS_BEGIN(c) \
 
255
                        KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) \
 
256
                        KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServName) \
 
257
                KVSM_PARAMETERS_END(c) \
 
258
                \
 
259
                if(szNetName.isEmpty()) \
 
260
                { \
 
261
                        c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \
 
262
                        return false; \
 
263
                } \
 
264
                \
 
265
                if(szServName.isEmpty()) \
 
266
                { \
 
267
                        c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); \
 
268
                        return false; \
 
269
                } \
 
270
                \
 
271
                KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \
 
272
                if(!pRecord) \
 
273
                { \
 
274
                        c->error(__tr2qs_ctx("The specified network does not exist","serverdb")); \
 
275
                        return false; \
 
276
                } \
 
277
                \
 
278
                KviIrcServer * pServer = pRecord->findServer(szServName); \
 
279
                if(!pServer) \
 
280
                { \
 
281
                        c->error(__tr2qs_ctx("The specified server does not exist","serverdb")); \
 
282
                        return false; \
 
283
                }
 
284
 
 
285
 
 
286
#define END_SERVERDB_GET_SERVER_PROPERTY \
175
287
                return true; \
176
288
        }
177
289
 
178
290
#define SERVERDB_GET_SERVER_PROPERTY(__functionName,__callName,__variantSetCallName) \
179
 
        static bool __functionName(KviKvsModuleFunctionCall * c) \
180
 
        { \
181
 
                QString szNetName, szServName; \
182
 
                \
183
 
                KVSM_PARAMETERS_BEGIN(c) \
184
 
                        KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) \
185
 
                        KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServName) \
186
 
                KVSM_PARAMETERS_END(c) \
187
 
                \
188
 
                if(szNetName.isEmpty()) \
189
 
                { \
190
 
                        c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \
191
 
                        return false; \
192
 
                } \
193
 
                \
194
 
                if(szServName.isEmpty()) \
195
 
                { \
196
 
                        c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); \
197
 
                        return false; \
198
 
                } \
199
 
                \
200
 
                KviNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \
201
 
                if(!pRecord) \
202
 
                { \
203
 
                        c->error(__tr2qs_ctx("The specified network does not exist","serverdb")); \
204
 
                        return false; \
205
 
                } \
206
 
                \
207
 
                KviServer * pServer = pRecord->findServer(szServName); \
208
 
                if(!pServer) \
209
 
                { \
210
 
                        c->error(__tr2qs_ctx("The specified server does not exist","serverdb")); \
211
 
                        return false; \
212
 
                } \
213
 
                \
 
291
                BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \
214
292
                c->returnValue()->__variantSetCallName(pServer->__callName()); \
215
 
                \
216
 
                return true; \
217
 
        }
 
293
                END_SERVERDB_GET_SERVER_PROPERTY
 
294
 
218
295
 
219
296
/*
220
297
        @doc: serverdb.networkNickName
224
301
                $serverdb.networkNickName
225
302
        @short:
226
303
                Returns the nickname
227
 
        @synthax:
228
 
                <string> $serverdb.networkNickName(<string:network>)
 
304
        @syntax:
 
305
                <string> $serverdb.networkNickName(<network:string>)
229
306
        @description:
230
307
                Returns the nickname set for the network <network> if set
231
308
        @seealso:
241
318
                $serverdb.networkUserName
242
319
        @short:
243
320
                Returns the username
244
 
        @synthax:
245
 
                <string> $serverdb.networkUserName(<string:network>)
 
321
        @syntax:
 
322
                <string> $serverdb.networkUserName(<network:string>)
246
323
        @description:
247
 
                Returns the username set for the network <network> if set
 
324
                Returns the username set for the network <network> if set.
248
325
        @seealso:
249
326
                [module:serverdb]ServerDB module documentation[/module]
250
327
*/
258
335
                $serverdb.networkRealName
259
336
        @short:
260
337
                Returns the realname
261
 
        @synthax:
262
 
                <string> $serverdb.networkRealName(<string:network>)
 
338
        @syntax:
 
339
                <string> $serverdb.networkRealName(<network:string>)
263
340
        @description:
264
341
                Returns the realname set for the network <network> if set
265
342
        @seealso:
275
352
                $serverdb.networkEncoding
276
353
        @short:
277
354
                Returns the encoding
278
 
        @synthax:
279
 
                <string> $serverdb.networkEncoding(<string:network>)
 
355
        @syntax:
 
356
                <string> $serverdb.networkEncoding(<network:string>)
280
357
        @description:
281
358
                Returns the encoding used for the network <network> for server specific messages, like channel and nick names, if set
282
359
        @seealso:
292
369
                $serverdb.networkTextEncoding
293
370
        @short:
294
371
                Returns the encoding
295
 
        @synthax:
296
 
                <string> $serverdb.networkTextEncoding(<string:network>)
 
372
        @syntax:
 
373
                <string> $serverdb.networkTextEncoding(<network:string>)
297
374
        @description:
298
375
                Returns the encoding used for the network <network> for text messages, if set
299
376
        @seealso:
309
386
                $serverdb.networkDescription
310
387
        @short:
311
388
                Returns the description
312
 
        @synthax:
313
 
                <string> $serverdb.networkDescription(<string:network>)
 
389
        @syntax:
 
390
                <string> $serverdb.networkDescription(<network:string>)
314
391
        @description:
315
392
                Returns the description set for the network <network> if set
316
393
        @seealso:
326
403
                $serverdb.networkConnectCommand
327
404
        @short:
328
405
                Returns the connect command
329
 
        @synthax:
330
 
                <string> $serverdb.networkConnectCommand(<string:network>)
 
406
        @syntax:
 
407
                <string> $serverdb.networkConnectCommand(<network:string>)
331
408
        @description:
332
409
                Returns the connect command set for the network <network> if set
333
410
        @seealso:
343
420
                $serverdb.networkLoginCommand
344
421
        @short:
345
422
                Returns the login command
346
 
        @synthax:
347
 
                <string> $serverdb.networkLoginCommand(<string:network>)
 
423
        @syntax:
 
424
                <string> $serverdb.networkLoginCommand(<network:string>)
348
425
        @description:
349
426
                Returns the login command set for the network <network> if set
350
427
        @seealso:
360
437
                $serverdb.networkName
361
438
        @short:
362
439
                Returns the name
363
 
        @synthax:
364
 
                <string> $serverdb.networkName(<string:network>)
 
440
        @syntax:
 
441
                <string> $serverdb.networkName(<network:string>)
365
442
        @description:
366
443
                Returns the name of the network <network>
367
444
        @seealso:
370
447
SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkName,name)
371
448
 
372
449
/*
 
450
        @doc: serverdb.networkJoinChannels
 
451
        @type:
 
452
                function
 
453
        @title:
 
454
                $serverdb.networkJoinChannels
 
455
        @short:
 
456
                Returns the list of autojoin channels
 
457
        @syntax:
 
458
                <string> $serverdb.networkJoinChannels(<network:string>)
 
459
        @description:
 
460
                Returns an array of autojoin channels and their relative passwords set for the network <network>[br]
 
461
                Each item in the array is in the format <channel:string>:<password:string>
 
462
        @seealso:
 
463
                [module:serverdb]ServerDB module documentation[/module]
 
464
*/
 
465
BEGIN_SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkJoinChannels)
 
466
 
 
467
        KviKvsArray * pArray = new KviKvsArray();
 
468
 
 
469
        QStringList * pAutoJoinChannels = pNetwork->autoJoinChannelList();
 
470
        if(pAutoJoinChannels)
 
471
        {
 
472
                kvs_uint_t idx = 0;
 
473
                foreach(QString szEntry,*pAutoJoinChannels)
 
474
                {
 
475
                        pArray->set(idx,new KviKvsVariant(szEntry));
 
476
                        idx++;
 
477
                }
 
478
        }
 
479
 
 
480
        c->returnValue()->setArray(pArray);
 
481
 
 
482
END_SERVERDB_GET_NETWORK_PROPERTY
 
483
 
 
484
/*
373
485
        @doc: serverdb.serverNickName
374
486
        @type:
375
487
                function
377
489
                $serverdb.serverNickName
378
490
        @short:
379
491
                Returns the nickname
380
 
        @synthax:
381
 
                <string> $serverdb.serverNickName(<string:network>,<string:server>)
 
492
        @syntax:
 
493
                <string> $serverdb.serverNickName(<network:string>,<server:string>)
382
494
        @description:
383
495
                Returns the nickname set for the server <server> of the network <network> if set
384
496
        @seealso:
394
506
                $serverdb.serverUserName
395
507
        @short:
396
508
                Returns the username
397
 
        @synthax:
398
 
                <string> $serverdb.serverUserName(<string:network>,<string:server>)
 
509
        @syntax:
 
510
                <string> $serverdb.serverUserName(<network:string>,<server:string>)
399
511
        @description:
400
512
                Returns the username set for the server <server> of the network <network> if set
401
513
        @seealso:
411
523
                $serverdb.serverRealName
412
524
        @short:
413
525
                Returns the realname
414
 
        @synthax:
415
 
                <string> $serverdb.serverRealName(<string:network>,<string:server>)
 
526
        @syntax:
 
527
                <string> $serverdb.serverRealName(<network:string>,<server:string>)
416
528
        @description:
417
529
                Returns the realname set for the server <server> of the network <network> if set
418
530
        @seealso:
428
540
                $serverdb.serverEncoding
429
541
        @short:
430
542
                Returns the encoding
431
 
        @synthax:
432
 
                <string> $serverdb.serverEncoding(<string:network>,<string:server>)
 
543
        @syntax:
 
544
                <string> $serverdb.serverEncoding(<network:string>,<server:string>)
433
545
        @description:
434
546
                Returns the encoding used for the server <server> of the network <network> for server specific messages, like channel and nick names, if set
435
547
        @seealso:
445
557
                $serverdb.serverTextEncoding
446
558
        @short:
447
559
                Returns the encoding
448
 
        @synthax:
449
 
                <string> $serverdb.serverTextEncoding(<string:network>,<string:server>)
 
560
        @syntax:
 
561
                <string> $serverdb.serverTextEncoding(<network:string>,<server:string>)
450
562
        @description:
451
563
                Returns the encoding used for the server <server> of the network <network> for server specific messages, like channel and nick names, if set
452
564
        @seealso:
462
574
                $serverdb.serverDescription
463
575
        @short:
464
576
                Returns the description
465
 
        @synthax:
466
 
                <string> $serverdb.serverDescription(<string:network>,<string:server>)
 
577
        @syntax:
 
578
                <string> $serverdb.serverDescription(<network:string>,<server:string>)
467
579
        @description:
468
580
                Returns the description set for the server <server> of the network <network> if set
469
581
        @seealso:
479
591
                $serverdb.serverConnectCommand
480
592
        @short:
481
593
                Returns the connect command
482
 
        @synthax:
483
 
                <string> $serverdb.serverConnectCommand(<string:network>,<string:server>)
 
594
        @syntax:
 
595
                <string> $serverdb.serverConnectCommand(<network:string>,<server:string>)
484
596
        @description:
485
597
                Returns the connect command set for the server <server> of the network <network> if set
486
598
        @seealso:
496
608
                $serverdb.serverLoginCommand
497
609
        @short:
498
610
                Returns the login command
499
 
        @synthax:
500
 
                <string> $serverdb.serverLoginCommand(<string:network>,<string:server>)
 
611
        @syntax:
 
612
                <string> $serverdb.serverLoginCommand(<network:string>,<server:string>)
501
613
        @description:
502
614
                Returns the login command set for the server <server> of the network <network> if set
503
615
        @seealso:
513
625
                $serverdb.serverIp
514
626
        @short:
515
627
                Returns the IP address
516
 
        @synthax:
517
 
                <string> $serverdb.serverIp(<string:network>,<string:server>)
 
628
        @syntax:
 
629
                <string> $serverdb.serverIp(<network:string>,<server:string>)
518
630
        @description:
519
631
                Returns the IP address of the server <server> of the network <network>
520
632
        @seealso:
530
642
                $serverdb.serverId
531
643
        @short:
532
644
                Returns the ID
533
 
        @synthax:
534
 
                <string> $serverdb.serverId(<string:network>,<string:server>)
 
645
        @syntax:
 
646
                <string> $serverdb.serverId(<network:string>,<server:string>)
535
647
        @description:
536
648
                Returns the ID of the server <server> of the network <network>
537
649
        @seealso:
547
659
                $serverdb.serverPassword
548
660
        @short:
549
661
                Returns the password
550
 
        @synthax:
551
 
                <string> $serverdb.serverPassword(<string:network>,<string:server>)
 
662
        @syntax:
 
663
                <string> $serverdb.serverPassword(<network:string>,<server:string>)
552
664
        @description:
553
665
                Returns the password of the server <server> of the network <network> if set
554
666
        @seealso:
564
676
                $serverdb.serverPort
565
677
        @short:
566
678
                Returns the port
567
 
        @synthax:
568
 
                <int> $serverdb.serverPort(<string:network>,<string:server>)
 
679
        @syntax:
 
680
                <int> $serverdb.serverPort(<network:string>,<server:string>)
569
681
        @description:
570
682
                Returns the port of the server <server> of the network <network> if set
571
683
        @seealso:
581
693
                $serverdb.isAutoConnect
582
694
        @short:
583
695
                Returns the autoconnect status
584
 
        @synthax:
585
 
                <bool> $serverdb.isAutoConnect(<string:network>,<string:server>)
 
696
        @syntax:
 
697
                <bool> $serverdb.isAutoConnect(<network:string>,<server:string>)
586
698
        @description:
587
699
                Returns true if the server <server> of the network <network> if set to autoconnect, false otherwise
588
700
        @seealso:
598
710
                $serverdb.isIPv6
599
711
        @short:
600
712
                Returns the IPv6 status
601
 
        @synthax:
602
 
                <bool> $serverdb.isIPv6(<string:network>,<string:server>)
 
713
        @syntax:
 
714
                <bool> $serverdb.isIPv6(<network:string>,<server:string>)
603
715
        @description:
604
716
                Returns true if the server <server> of the network <network> if set to connect using IPv6 sockets, false otherwise
605
717
        @seealso:
615
727
                $serverdb.isSSL
616
728
        @short:
617
729
                Returns the SSL status
618
 
        @synthax:
619
 
                <bool> $serverdb.isSSL(<string:network>,<string:server>)
 
730
        @syntax:
 
731
                <bool> $serverdb.isSSL(<network:string>,<server:string>)
620
732
        @description:
621
733
                Returns true if the server <server> of the network <network> if set to connect using SSL (Secure Socket Layer) sockets, false otherwise
622
734
        @seealso:
632
744
                $serverdb.cacheIp
633
745
        @short:
634
746
                Returns the cache-ip status
635
 
        @synthax:
636
 
                <bool> $serverdb.cacheIp(<string:network>,<string:server>)
 
747
        @syntax:
 
748
                <bool> $serverdb.cacheIp(<network:string>,<server:string>)
637
749
        @description:
638
750
                Returns true if KVIrc is set to cache the ip of the server <server> of the network <network>, false otherwise
639
751
        @seealso:
642
754
SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverCacheIp,cacheIp,setBoolean)
643
755
 
644
756
/*
 
757
        @doc: serverdb.serverJoinChannels
 
758
        @type:
 
759
                function
 
760
        @title:
 
761
                $serverdb.serverJoinChannels
 
762
        @short:
 
763
                Returns the list of autojoin channels
 
764
        @syntax:
 
765
                <array> $serverdb.serverJoinChannels(<network:string>,<server:string>)
 
766
        @description:
 
767
                Returns an array containing the autojoin channels and their relative passwords set for the server <server> of the network <network>[br]
 
768
                Each item in the array is in the format channel_name:password
 
769
        @seealso:
 
770
                [module:serverdb]ServerDB module documentation[/module]
 
771
*/
 
772
BEGIN_SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverJoinChannels)
 
773
 
 
774
        KviKvsArray * pArray = new KviKvsArray();
 
775
 
 
776
        QStringList * pAutoJoinChannels = pServer->autoJoinChannelList();
 
777
        if(pAutoJoinChannels)
 
778
        {
 
779
                kvs_uint_t idx = 0;
 
780
                foreach(QString szEntry,*pAutoJoinChannels)
 
781
                {
 
782
                        pArray->set(idx,new KviKvsVariant(szEntry));
 
783
                        idx++;
 
784
                }
 
785
        }
 
786
 
 
787
        c->returnValue()->setArray(pArray);
 
788
 
 
789
END_SERVERDB_GET_SERVER_PROPERTY
 
790
 
 
791
 
 
792
/*
645
793
        @doc: serverdb.addNetwork
646
794
        @type:
647
795
                command
678
826
                return false;
679
827
        }
680
828
 
681
 
        KviNetwork * pNetwork = g_pServerDataBase->findNetwork(szNetName);
 
829
        KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szNetName);
682
830
        if(pNetwork)
683
831
        {
684
832
                if(c->switches()->find('q',"quiet")) return true;
686
834
                return false;
687
835
        }
688
836
 
689
 
        pNetwork = new KviNetwork(szNetName);
 
837
        pNetwork = new KviIrcNetwork(szNetName);
690
838
        if(c->switches()->find('a',"autoconnect")) pNetwork->setAutoConnect(true);
691
839
 
692
840
        g_pServerDataBase->addNetwork(pNetwork);
702
850
        @short:
703
851
                Adds a server
704
852
        @syntax:
705
 
                serverdb.addServer [switches] <string:network> <string:server>
 
853
                serverdb.addServer [switches] <network:string> <server:string>
706
854
        @description:
707
855
                Adds the server <server> to the network <network>.
708
856
        @switches:
755
903
                return false;
756
904
        }
757
905
 
758
 
        KviNetwork * pRecord = g_pServerDataBase->findNetwork(szNetwork);
 
906
        KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetwork);
759
907
        if(!pRecord)
760
908
        {
761
909
                // FIXME: default to orphan servers
763
911
                return false;
764
912
        }
765
913
 
766
 
        KviServer * pServer = new KviServer();
 
914
        KviIrcServer * pServer = new KviIrcServer();
767
915
        pServer->setHostName(szServer);
768
916
 
769
 
        KviServer * pServerRecord = pRecord->findServer(pServer);
 
917
        KviIrcServer * pServerRecord = pRecord->findServer(pServer);
770
918
        if(pServerRecord)
771
919
        {
772
920
                if(c->switches()->find('q',"quiet")) return true;
781
929
 
782
930
        QString tmp;
783
931
 
784
 
        unsigned int uPort;
785
932
        if(c->switches()->getAsStringIfExisting('p',"port",tmp))
786
933
        {
787
934
                bool bOk;
788
 
                uPort = tmp.toInt(&bOk);
 
935
                unsigned int uPort = tmp.toInt(&bOk);
789
936
                if(!bOk) uPort = 6667;
790
937
                pServer->setPort(uPort);
791
938
        }
800
947
#define SERVERDB_SET_NETWORK_PROPERTY(__functionName,__callName) \
801
948
        static bool __functionName(KviKvsModuleCommandCall * c) \
802
949
        { \
803
 
                QString szName, szPropertyName; \
 
950
                QString szName, szPropertyValue; \
804
951
                \
805
952
                KVSM_PARAMETERS_BEGIN(c) \
806
953
                        KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) \
807
 
                        KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyName) \
 
954
                        KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyValue) \
808
955
                KVSM_PARAMETERS_END(c) \
809
956
                \
810
957
                if(szName.isEmpty()) \
813
960
                        return false; \
814
961
                } \
815
962
                \
816
 
                if(szPropertyName.isEmpty()) \
817
 
                { \
818
 
                        c->error(__tr2qs_ctx("You must provide the value as parameter","serverdb")); \
819
 
                        return false; \
820
 
                } \
821
 
                \
822
 
                KviNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \
 
963
                KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \
823
964
                if(!pNetwork) \
824
965
                { \
825
966
                        if(c->switches()->find('q',"quiet")) return true; \
827
968
                        return false; \
828
969
                } \
829
970
                \
830
 
                pNetwork->__callName(szPropertyName); \
 
971
                pNetwork->__callName(szPropertyValue); \
831
972
                \
832
973
                return true; \
833
974
        }
835
976
#define SERVERDB_SET_SERVER_PROPERTY(__functionName,__callName) \
836
977
        static bool __functionName(KviKvsModuleCommandCall * c) \
837
978
        { \
838
 
                QString szNetName, szServName, szPropertyName; \
 
979
                QString szNetName, szServName, szPropertyValue; \
839
980
                \
840
981
                KVSM_PARAMETERS_BEGIN(c) \
841
982
                        KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) \
842
983
                        KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServName) \
843
 
                        KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyName) \
 
984
                        KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyValue) \
844
985
                KVSM_PARAMETERS_END(c) \
845
986
                \
846
987
                if(szNetName.isEmpty()) \
855
996
                        return false; \
856
997
                } \
857
998
                \
858
 
                if(szPropertyName.isEmpty()) \
859
 
                { \
860
 
                        c->error(__tr2qs_ctx("You must provide the value as parameter","serverdb")); \
861
 
                        return false; \
862
 
                } \
863
 
                \
864
 
                KviNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \
 
999
                KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \
865
1000
                if(!pRecord) \
866
1001
                { \
867
1002
                        if(c->switches()->find('q',"quiet")) return true; \
869
1004
                        return false; \
870
1005
                } \
871
1006
                \
872
 
                KviServer * pServer = pRecord->findServer(szServName); \
 
1007
                KviIrcServer * pServer = pRecord->findServer(szServName); \
873
1008
                if(!pServer) \
874
1009
                { \
875
1010
                        if(c->switches()->find('q',"quiet")) return true; \
877
1012
                        return false; \
878
1013
                } \
879
1014
                \
880
 
                pServer->__callName(szPropertyName); \
 
1015
                pServer->__callName(szPropertyValue); \
881
1016
                \
882
1017
                return true; \
883
1018
        }
891
1026
        @short:
892
1027
                Sets the nickname
893
1028
        @syntax:
894
 
                serverdb.setNetworkNickName [switches] <string:name> <string:nick>
 
1029
                serverdb.setNetworkNickName [switches] <name:string> <nick:string>
895
1030
        @description:
896
1031
                Sets the nickname <nick> for the specified network <name>.
897
1032
        @switches:
916
1051
        @short:
917
1052
                Sets the username
918
1053
        @syntax:
919
 
                serverdb.setNetworkUserName [switches] <string:name> <string:username>
 
1054
                serverdb.setNetworkUserName [switches] <name:string> <username:string>
920
1055
        @description:
921
1056
                Sets the username <username> for the specified network <name>.
922
1057
        @switches:
941
1076
        @short:
942
1077
                Sets the realname
943
1078
        @syntax:
944
 
                serverdb.setNetworkRealName [switches] <string:name> <string:realname>
 
1079
                serverdb.setNetworkRealName [switches] <name:string> <realname:string>
945
1080
        @description:
946
1081
                Sets the realname <realname> for the specified network <name>.
947
1082
        @switches:
966
1101
        @short:
967
1102
                Sets the encoding
968
1103
        @syntax:
969
 
                serverdb.setNetworkEncoding [switches] <string:name> <string:encoding>
 
1104
                serverdb.setNetworkEncoding [switches] <name:string> <encoding:string>
970
1105
        @description:
971
1106
                Sets the encoding <encoding> for the specified network <name>. This encoding will be used for server-specific
972
1107
                text, like channel names and nicknames.
992
1127
        @short:
993
1128
                Sets the encoding
994
1129
        @syntax:
995
 
                serverdb.setNetworkTextEncoding [switches] <string:name> <string:encoding>
 
1130
                serverdb.setNetworkTextEncoding [switches] <name:string> <encoding:string>
996
1131
        @description:
997
1132
                Sets the encoding <encoding> for the specified network <name>. This encoding will be used for text messages.
998
1133
        @switches:
1017
1152
        @short:
1018
1153
                Sets the description
1019
1154
        @syntax:
1020
 
                serverdb.setNetworkDescription [switches] <string:name> <string:description>
 
1155
                serverdb.setNetworkDescription [switches] <name:string> <description:string>
1021
1156
        @description:
1022
1157
                Sets the description <description> for the specified network <name>.
1023
1158
        @switches:
1042
1177
        @short:
1043
1178
                Sets the connect command
1044
1179
        @syntax:
1045
 
                serverdb.setNetworkConnectCommand [switches] <string:name> <string:command>
 
1180
                serverdb.setNetworkConnectCommand [switches] <name:string> <command:string>
1046
1181
        @description:
1047
1182
                Sets the command <command> to run on connect for the specified network <name>.
1048
1183
        @switches:
1067
1202
        @short:
1068
1203
                Sets the login command
1069
1204
        @syntax:
1070
 
                serverdb.setNetworkLoginCommand [switches] <string:name> <string:command>
 
1205
                serverdb.setNetworkLoginCommand [switches] <name:string> <command:string>
1071
1206
        @description:
1072
1207
                Sets the command <command> to run on login for the specified network <name>.
1073
1208
        @switches:
1084
1219
SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkLoginCommand,setOnLoginCommand)
1085
1220
 
1086
1221
/*
 
1222
        @doc: serverdb.setNetworkJoinChannels
 
1223
        @type:
 
1224
                command
 
1225
        @title:
 
1226
                serverdb.setNetworkJoinChannels
 
1227
        @short:
 
1228
                Sets the autojoin channels list
 
1229
        @syntax:
 
1230
                serverdb.setNetworkJoinChannels <name:string> <channel_list:string>
 
1231
        @description:
 
1232
                Sets the autojoin channels list for the specified network <name>.[br]
 
1233
                Items in the list have to be separated by a comma, and each item has to be in the form <channel:string>:<password:string>
 
1234
        @examples:
 
1235
                [example]
 
1236
                [comment]Set two autojoin channels for freenode[/comment][br]
 
1237
                serverdb.setNetworkJoinChannels Freenode #kvirc:,#secretchan:password
 
1238
                [/example]
 
1239
        @seealso:
 
1240
                [module:serverdb]ServerDB module documentation[/module]
 
1241
*/
 
1242
SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkJoinChannels,setAutoJoinChannelList)
 
1243
 
 
1244
/*
1087
1245
        @doc: serverdb.setServerNickName
1088
1246
        @type:
1089
1247
                command
1092
1250
        @short:
1093
1251
                Sets the nickname
1094
1252
        @syntax:
1095
 
                serverdb.setServerNickName [switches] <string:name> <string:nick>
 
1253
                serverdb.setServerNickName [switches] <network:string> <server:string> <nick:string>
1096
1254
        @description:
1097
 
                Sets the nickname <nick> for the specified server <name>.
 
1255
                Sets the nickname <nick> for the specified server <server> in the network <network>.
1098
1256
        @switches:
1099
1257
                !sw: -q | --quiet
1100
1258
                Do not print errors if the server already exists.
1117
1275
        @short:
1118
1276
                Sets the username
1119
1277
        @syntax:
1120
 
                serverdb.setServerUserName [switches] <string:name> <string:username>
 
1278
                serverdb.setServerUserName [switches] <network:string> <server:string> <username:string>
1121
1279
        @description:
1122
 
                Sets the username <username> for the specified server <name>.
 
1280
                Sets the username <username> for the specified server <server> in the network <network>.
1123
1281
        @switches:
1124
1282
                !sw: -q | --quiet
1125
1283
                Do not print errors if the server already exists.
1142
1300
        @short:
1143
1301
                Sets the realname
1144
1302
        @syntax:
1145
 
                serverdb.setServerRealName [switches] <string:name> <string:realname>
 
1303
                serverdb.setServerRealName [switches] <network:string> <server:string> <realname:string>
1146
1304
        @description:
1147
 
                Sets the realname <realname> for the specified server <name>.
 
1305
                Sets the realname <realname> for the specified server <server> in the network <network>.
1148
1306
        @switches:
1149
1307
                !sw: -q | --quiet
1150
1308
                Do not print errors if the server already exists.
1167
1325
        @short:
1168
1326
                Sets the encoding
1169
1327
        @syntax:
1170
 
                serverdb.setServerEncoding [switches] <string:name> <string:encoding>
 
1328
                serverdb.setServerEncoding [switches] <network:string> <server:string> <encoding:string>
1171
1329
        @description:
1172
 
                Sets the encoding <encoding> for the specified server <name>. This encoding will be used for server-specific
 
1330
                Sets the encoding <encoding> for the specified server <server> in the network <network>. This encoding will be used for server-specific
1173
1331
                text, like channel names and nicknames.
1174
1332
        @switches:
1175
1333
                !sw: -q | --quiet
1177
1335
        @examples:
1178
1336
                [example]
1179
1337
                [comment]Quietly sets the encoding UTF-8 for the irc.freenode.net server[/comment][br]
1180
 
                serverdb.setServerEncoding -q Freenode UTF-8
 
1338
                serverdb.setServerEncoding -q irc.freenode.net UTF-8
1181
1339
                [/example]
1182
1340
        @seealso:
1183
1341
                [module:serverdb]ServerDB module documentation[/module]
1193
1351
        @short:
1194
1352
                Sets the text encoding
1195
1353
        @syntax:
1196
 
                serverdb.setServerTextEncoding [switches] <string:name> <string:encoding>
 
1354
                serverdb.setServerTextEncoding [switches] <network:string> <server:string> <encoding:string>
1197
1355
        @description:
1198
 
                Sets the encoding <encoding> for the specified server <name>. This encoding will be used for text messages.
 
1356
                Sets the encoding <encoding> for the specified server <server> in the network <network>. This encoding will be used for text messages.
1199
1357
        @switches:
1200
1358
                !sw: -q | --quiet
1201
1359
                Do not print errors if the server already exists.
1202
1360
        @examples:
1203
1361
                [example]
1204
1362
                [comment]Quietly sets the text encoding UTF-8 for the irc.freenode.net server[/comment][br]
1205
 
                serverdb.setServerTextEncoding -q Freenode UTF-8
 
1363
                serverdb.setServerTextEncoding -q irc.freenode.net UTF-8
1206
1364
                [/example]
1207
1365
        @seealso:
1208
1366
                [module:serverdb]ServerDB module documentation[/module]
1218
1376
        @short:
1219
1377
                Sets the description
1220
1378
        @syntax:
1221
 
                serverdb.setServerDescription [switches] <string:name> <string:description>
 
1379
                serverdb.setServerDescription [switches] <network:string> <server:string> <description:string>
1222
1380
        @description:
1223
 
                Sets the description <description> for the specified server <name>.
 
1381
                Sets the description <description> for the specified server <server> in the network <network>.
1224
1382
        @switches:
1225
1383
                !sw: -q | --quiet
1226
1384
                Do not print errors if the server already exists.
1243
1401
        @short:
1244
1402
                Sets the connect command
1245
1403
        @syntax:
1246
 
                serverdb.setServerConnectCommand [switches] <string:name> <string:command>
 
1404
                serverdb.setServerConnectCommand [switches] <network:string> <server:string> <command:string>
1247
1405
        @description:
1248
 
                Sets the command <command> to run on connect for the specified server <name>.
 
1406
                Sets the command <command> to run on connect for the specified server <server> in the network <network>.
1249
1407
        @switches:
1250
1408
                !sw: -q | --quiet
1251
1409
                Do not print errors if the server already exists.
1268
1426
        @short:
1269
1427
                Sets the login command
1270
1428
        @syntax:
1271
 
                serverdb.setServerLoginCommand [switches] <string:name> <string:command>
 
1429
                serverdb.setServerLoginCommand [switches] <network:string> <server:string> <command:string>
1272
1430
        @description:
1273
 
                Sets the command <command> to run on login for the specified server <name>.
 
1431
                Sets the command <command> to run on login for the specified server <server> in the network <network>.
1274
1432
        @switches:
1275
1433
                !sw: -q | --quiet
1276
1434
                Do not print errors if the server already exists.
1284
1442
*/
1285
1443
SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerLoginCommand,setOnLoginCommand)
1286
1444
 
 
1445
/*
 
1446
        @doc: serverdb.setServerJoinChannels
 
1447
        @type:
 
1448
                command
 
1449
        @title:
 
1450
                serverdb.setServerJoinChannels
 
1451
        @short:
 
1452
                Sets the autojoin channels list
 
1453
        @syntax:
 
1454
                serverdb.setServerJoinChannels <network:string> <server:string> <channel_list:string>
 
1455
        @description:
 
1456
                Sets the autojoin channels list for the specified server <server> in the network <network>.[br]
 
1457
                Items in the list have to be separated by a comma, and each item has to be in the form <channel:string>:<password:string>
 
1458
        @examples:
 
1459
                [example]
 
1460
                [comment]Set two autojoin channels for irc.freenode.net[/comment][br]
 
1461
                serverdb.setServerJoinChannels irc.freenode.net #kvirc:,#secretchan:password
 
1462
                [/example]
 
1463
        @seealso:
 
1464
                [module:serverdb]ServerDB module documentation[/module]
 
1465
*/
 
1466
SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerJoinChannels,setAutoJoinChannelList)
 
1467
 
1287
1468
static bool serverdb_module_init(KviModule * m)
1288
1469
{
1289
1470
        /*
1300
1481
        KVSM_REGISTER_FUNCTION(m,"networkNickName",serverdb_kvs_fnc_networkNickName);
1301
1482
        KVSM_REGISTER_FUNCTION(m,"networkRealName",serverdb_kvs_fnc_networkRealName);
1302
1483
        KVSM_REGISTER_FUNCTION(m,"networkUserName",serverdb_kvs_fnc_networkUserName);
 
1484
        KVSM_REGISTER_FUNCTION(m,"networkJoinChannels",serverdb_kvs_fnc_networkJoinChannels);
1303
1485
        KVSM_REGISTER_FUNCTION(m,"serverConnectCommand",serverdb_kvs_fnc_serverConnectCommand);
1304
1486
        KVSM_REGISTER_FUNCTION(m,"serverDescription",serverdb_kvs_fnc_serverDescription);
1305
1487
        KVSM_REGISTER_FUNCTION(m,"serverEncoding",serverdb_kvs_fnc_serverEncoding);
1312
1494
        KVSM_REGISTER_FUNCTION(m,"serverPort",serverdb_kvs_fnc_serverPort);
1313
1495
        KVSM_REGISTER_FUNCTION(m,"serverRealName",serverdb_kvs_fnc_serverRealName);
1314
1496
        KVSM_REGISTER_FUNCTION(m,"serverUserName",serverdb_kvs_fnc_serverUserName);
 
1497
        KVSM_REGISTER_FUNCTION(m,"serverJoinChannels",serverdb_kvs_fnc_serverJoinChannels);
1315
1498
        KVSM_REGISTER_FUNCTION(m,"isAutoConnect",serverdb_kvs_fnc_serverAutoConnect);
1316
1499
        KVSM_REGISTER_FUNCTION(m,"isIPv6",serverdb_kvs_fnc_serverIPv6);
1317
1500
        KVSM_REGISTER_FUNCTION(m,"isSSL",serverdb_kvs_fnc_serverSSL);
1328
1511
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkNickName",serverdb_kvs_cmd_setNetworkNickName);
1329
1512
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkRealName",serverdb_kvs_cmd_setNetworkRealName);
1330
1513
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkUserName",serverdb_kvs_cmd_setNetworkUserName);
 
1514
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkJoinChannels",serverdb_kvs_cmd_setNetworkJoinChannels);
1331
1515
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerConnectCommand",serverdb_kvs_cmd_setServerConnectCommand);
1332
1516
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerEncoding",serverdb_kvs_cmd_setServerEncoding);
1333
1517
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerTextEncoding",serverdb_kvs_cmd_setServerTextEncoding);
1336
1520
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerNickName",serverdb_kvs_cmd_setServerNickName);
1337
1521
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerRealName",serverdb_kvs_cmd_setServerRealName);
1338
1522
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerUserName",serverdb_kvs_cmd_setServerUserName);
 
1523
        KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerJoinChannels",serverdb_kvs_cmd_setServerJoinChannels);
1339
1524
 
1340
1525
        return true;
1341
1526
}