Skip to content

Commit 70e3ac6

Browse files
committed
Port support for #13 umode registration from http://goo.gl/VTXXU
1 parent d2992d3 commit 70e3ac6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backends/async.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,14 @@ def reload_module(self, module):
100100

101101
def handle_connect(self):
102102
self.output('Connected')
103-
self.push('NICK %s\r\nUSER %s 0 0 :%s\r\n' %
104-
(config.nick, config.ident, config.ircname))
103+
mode_numeric = 0
104+
umodes = api.get_config_str("main", "umodes") or ''
105+
if 'w' in umodes:
106+
mode_numeric += 1 << 2 # Set bit 2 (rfc2812#section-3.1.3)
107+
if 'i' in umodes:
108+
mode_numeric += 1 << 3 # Set bit 3 (rfc2812#section-3.1.3)
109+
self.push('NICK %s\r\nUSER %s %d * :%s\r\n' %
110+
(config.nick, config.ident, mode_numeric, config.ircname))
105111

106112
def get_data(self):
107113
ret = self.data

0 commit comments

Comments
 (0)