]> git.pld-linux.org Git - packages/eventum.git/blob - eventum-irc-config.patch
- loose dep on qmail subpackage
[packages/eventum.git] / eventum-irc-config.patch
1 --- eventum-1.6.1/misc/irc/bot.php.orig 2005-09-17 17:28:04.000000000 +0300
2 +++ eventum-1.6.1/misc/irc/bot.php      2005-09-17 17:49:09.000000000 +0300
3 @@ -27,8 +27,9 @@
4  //
5  // @(#) $Id$
6  //
7 +require_once('/etc/eventum/core.php');
8 +include_once('/etc/eventum/irc.php');
9  
10 -include_once("../../config.inc.php");
11  include_once(APP_INC_PATH . "db_access.php");
12  include_once(APP_INC_PATH . "class.auth.php");
13  include_once(APP_INC_PATH . "class.lock.php");
14 @@ -38,22 +39,19 @@
15  
16  ini_set("memory_limit", "256M");
17  
18 +// compat with earlier releases where didn't have array -glen
19 +if (empty($irc_channels)) {
20 +    $irc_channels = array();
21 +    $irc_channels[$irc_default_project] = $irc_default_channel;
22 +}
23 +
24  // the following is the list of IRC channels that the bot should connect to,
25  // and the associated project name
26 -$channels = array(
27 -    Project::getID('Default Project') => array(
28 -        '#issues',
29 -    )
30 -);
31 -$irc_server_hostname = 'localhost';
32 -$irc_server_port = 6667;
33 -$nickname = 'EventumBOT';
34 -$realname = 'Eventum Issue Tracking System';
35 -// do you need a username/password to connect to this server? if 
36 -// so, fill in the next two variables
37 -$username = '';
38 -$password = '';
39 -
40 +$channels = array();
41 +foreach ($irc_channels as $proj => $chan) {
42 +    $proj_id = Project::getID($proj);
43 +    $channels[$proj_id] = $chan;
44 +}
45  
46  // ============================================
47  // ============================================
48 @@ -269,7 +267,7 @@
49      function _getChannels($prj_id)
50      {
51          global $channels;
52 -        return $channels[$prj_id];
53 +        return @$channels[$prj_id];
54      }
55      
56      
57 @@ -410,14 +408,16 @@
58  $irc->registerActionhandler(SMARTIRC_TYPE_QUERY, '^!?list-quarantined', $bot, 'listQuarantinedIssues');
59  
60  $irc->connect($irc_server_hostname, $irc_server_port);
61 -if (!empty($username)) {
62 -    $irc->login($nickname, $realname, 0, $username, $password);
63 -} else {
64 +if (empty($username)) {
65      $irc->login($nickname, $realname);
66 +} elseif (empty($password)) {
67 +    $irc->login($nickname, $realname, 0, $username);
68 +} else {
69 +    $irc->login($nickname, $realname, 0, $username, $password);
70  }
71  $irc->listen();
72  $irc->disconnect();
73  
74  // release the lock
75  Lock::release('irc_bot');
76 -?>
77 \ No newline at end of file
78 +?>
This page took 0.029046 seconds and 3 git commands to generate.