<!DOCTYPE html>
<html lang='en'>
<head>
<title>Organized cap inbound code in inbound.c instead of proto-irc.c. - torxchat.git - Unnamed repository; edit this file 'description' to name the repository.</title>
<meta name='generator' content='cgit 1.4.1'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/git-repos/cgit.css'/>
<link rel='alternate' title='Atom feed' href='http://soniex2.autistic.space/git-repos/torxchat.git/atom/?h=default' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/git-repos/'><img src='/git-repos/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/git-repos/'>index</a> : <a href='/git-repos/torxchat.git/'>torxchat.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='a01bd83c64b76da028d3c23b743a61bbbc62a2d2'/><select name='h' onchange='this.form.submit();'>
<option value='2812c94755b99ab2b3a959b89d605e2a41408a8d'>this commit</option>
<optgroup label='branches'><option value='branch-info'>branch-info</option>
<option value='default' selected='selected'>default</option>
<option value='fe-web'>fe-web</option>
<option value='feature/flexible-cert'>feature/flexible-cert</option>
<option value='feature/fork-branding'>feature/fork-branding</option>
<option value='feature/tls-srp'>feature/tls-srp</option>
<option value='feature/tor-i2p-dcc'>feature/tor-i2p-dcc</option>
<option value='fix-ub'>fix-ub</option>
</optgroup></select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Unnamed repository; edit this file 'description' to name the repository.</td><td class='sub right'>blog</td></tr></table>
<table class='tabs'><tr><td>
<a href='/git-repos/torxchat.git/'>summary</a> <a href='/git-repos/torxchat.git/refs/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>refs</a> <a href='/git-repos/torxchat.git/log/'>log</a> <a href='/git-repos/torxchat.git/tree/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>tree</a> <a class='active' href='/git-repos/torxchat.git/commit/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>commit</a> <a href='/git-repos/torxchat.git/diff/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>diff</a> <a href='/git-repos/torxchat.git/stats/'>stats</a></td><td class='form'><form class='right' method='get' action='/git-repos/torxchat.git/log/'>
<input type='hidden' name='id' value='a01bd83c64b76da028d3c23b743a61bbbc62a2d2'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='a01bd83c64b76da028d3c23b743a61bbbc62a2d2'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Diogo Sousa &lt;diogogsousa@gmail.com&gt;</td><td class='right'>2013-06-22 16:48:05 +0100</td></tr>
<tr><th>committer</th><td>Diogo Sousa &lt;diogogsousa@gmail.com&gt;</td><td class='right'>2013-06-28 16:04:06 +0100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/git-repos/torxchat.git/commit/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>a01bd83c64b76da028d3c23b743a61bbbc62a2d2</a> (<a href='/git-repos/torxchat.git/patch/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/git-repos/torxchat.git/tree/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>79eed83e41795112e1da9566f9eafd7df33f5fd9</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/git-repos/torxchat.git/commit/?id=6a0240aa181656dff00e664fd8cc60931b618a50'>6a0240aa181656dff00e664fd8cc60931b618a50</a> (<a href='/git-repos/torxchat.git/diff/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2&amp;id2=6a0240aa181656dff00e664fd8cc60931b618a50'>diff</a>)</td></tr></table>
<div class='commit-subject'>Organized cap inbound code in inbound.c instead of proto-irc.c.</div><pre class='commit-msg'></pre><div class='diffstat-header'><a href='/git-repos/torxchat.git/diff/?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>Diffstat</a></div><table summary='diffstat' class='diffstat'><tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/git-repos/torxchat.git/diff/src/common/inbound.c?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/inbound.c</a></td><td class='right'>130</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 100.0%;'/><td class='rem' style='width: 0.0%;'/><td class='none' style='width: 0.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/git-repos/torxchat.git/diff/src/common/inbound.h?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/inbound.h</a></td><td class='right'>9</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 6.2%;'/><td class='rem' style='width: 0.8%;'/><td class='none' style='width: 93.1%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/git-repos/torxchat.git/diff/src/common/proto-irc.c?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/proto-irc.c</a></td><td class='right'>127</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 7.7%;'/><td class='rem' style='width: 90.0%;'/><td class='none' style='width: 2.3%;'/></tr></table></td></tr>
</table><div class='diffstat-summary'>3 files changed, 148 insertions, 118 deletions</div><table summary='diff' class='diff'><tr><td><pre><span class='head'>diff --git a/src/common/inbound.c b/src/common/inbound.c
index 54c59ae4..070eb585 100644
--- a/<a href='/git-repos/torxchat.git/tree/src/common/inbound.c?id=6a0240aa181656dff00e664fd8cc60931b618a50'>src/common/inbound.c</a>
+++ b/<a href='/git-repos/torxchat.git/tree/src/common/inbound.c?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/inbound.c</a>
</span><span class='hunk'>@@ -1522,3 +1522,133 @@ inbound_identified (server *serv)	/* 'MODE +e MYSELF' on freenode */</span>
<span class='ctx'> 		check_autojoin_channels (serv);</span>
<span class='ctx'> 	}</span>
<span class='ctx'> }</span>
<span class='add'>+</span>
<span class='add'>+void</span>
<span class='add'>+inbound_cap_ack (server *serv, char *nick, char *extensions,</span>
<span class='add'>+					  const message_tags_data *tags_data)</span>
<span class='add'>+{</span>
<span class='add'>+	char *pass; /* buffer for SASL password */</span>
<span class='add'>+</span>
<span class='add'>+	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, serv-&gt;server_session, nick, extensions,</span>
<span class='add'>+								  NULL, NULL, 0, tags_data-&gt;timestamp);</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "identify-msg") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		serv-&gt;have_idmsg = TRUE;</span>
<span class='add'>+	}</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "multi-prefix") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		serv-&gt;have_namesx = TRUE;</span>
<span class='add'>+	}</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "away-notify") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		serv-&gt;have_awaynotify = TRUE;</span>
<span class='add'>+	}</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "account-notify") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		serv-&gt;have_accnotify = TRUE;</span>
<span class='add'>+	}</span>
<span class='add'>+					</span>
<span class='add'>+	if (strstr (extensions, "extended-join") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		serv-&gt;have_extjoin = TRUE;</span>
<span class='add'>+	}</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "sasl") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		char *user;</span>
<span class='add'>+</span>
<span class='add'>+		serv-&gt;have_sasl = TRUE;</span>
<span class='add'>+</span>
<span class='add'>+		user = (((ircnet *)serv-&gt;network)-&gt;user) </span>
<span class='add'>+			? (((ircnet *)serv-&gt;network)-&gt;user) : prefs.hex_irc_user_name;</span>
<span class='add'>+</span>
<span class='add'>+		EMIT_SIGNAL_TIMESTAMP (XP_TE_SASLAUTH, serv-&gt;server_session, user, NULL,</span>
<span class='add'>+									  NULL,	NULL,	0,	tags_data-&gt;timestamp);</span>
<span class='add'>+		tcp_send</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.causal.agency/cgit-pink/about/'>cgit-pink 1.4.1</a> (<a href='https://git-scm.com/'>git 2.36.1</a>) at 2025-01-25 18:34:27 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
	}</span>
<span class='add'>+}</span>
<span class='add'>+</span>
<span class='add'>+void</span>
<span class='add'>+inbound_cap_ls (server *serv, char *nick, char *extensions,</span>
<span class='add'>+					 const message_tags_data *tags_data)</span>
<span class='add'>+{</span>
<span class='add'>+	char buffer[256];	/* buffer for requesting capabilities and emitting the signal */</span>
<span class='add'>+	guint32 want_cap; /* format the CAP REQ string based on previous capabilities being requested or not */</span>
<span class='add'>+	guint32 want_sasl; /* CAP END shouldn't be sent when SASL is requested, it needs further responses */</span>
<span class='add'>+</span>
<span class='add'>+	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPLIST, serv-&gt;server_session, nick, extensions,</span>
<span class='add'>+								  NULL, NULL, 0, tags_data-&gt;timestamp);</span>
<span class='add'>+	want_cap = 0;</span>
<span class='add'>+	want_sasl = 0;</span>
<span class='add'>+</span>
<span class='add'>+	strcpy (buffer, "CAP REQ :");</span>
<span class='add'>+</span>
<span class='add'>+	if (strstr (extensions, "identify-msg") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "identify-msg ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+	if (strstr (extensions, "multi-prefix") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "multi-prefix ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+	if (strstr (extensions, "away-notify") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "away-notify ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+	if (strstr (extensions, "account-notify") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "account-notify ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+	if (strstr (extensions, "extended-join") != 0)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "extended-join ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+	/* if the SASL password is set AND auth mode is set to SASL, request SASL auth */</span>
<span class='add'>+	if (strstr (extensions, "sasl") != 0 &amp;&amp; strlen (serv-&gt;password) != 0 &amp;&amp; serv-&gt;loginmethod == LOGIN_SASL)</span>
<span class='add'>+	{</span>
<span class='add'>+		strcat (buffer, "sasl ");</span>
<span class='add'>+		want_cap = 1;</span>
<span class='add'>+		want_sasl = 1;</span>
<span class='add'>+	}</span>
<span class='add'>+</span>
<span class='add'>+	if (want_cap)</span>
<span class='add'>+	{</span>
<span class='add'>+		/* buffer + 9 = emit buffer without "CAP REQ :" */</span>
<span class='add'>+		EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPREQ, serv-&gt;server_session,</span>
<span class='add'>+									  buffer + 9, NULL, NULL, NULL, 0,</span>
<span class='add'>+									  tags_data-&gt;timestamp);</span>
<span class='add'>+		tcp_sendf (serv, "%s\r\n", buffer);</span>
<span class='add'>+	}</span>
<span class='add'>+	if (!want_sasl)</span>
<span class='add'>+	{</span>
<span class='add'>+		/* if we use SASL, CAP END is dealt via raw numerics */</span>
<span class='add'>+		tcp_send_len (serv, "CAP END\r\n", 9);</span>
<span class='add'>+	}</span>
<span class='add'>+}</span>
<span class='add'>+</span>
<span class='add'>+void</span>
<span class='add'>+inbound_cap_nak (server *serv, const message_tags_data *tags_data)</span>
<span class='add'>+{</span>
<span class='add'>+	tcp_send_len (serv, "CAP END\r\n", 9);</span>
<span class='add'>+}</span>
<span class='add'>+</span>
<span class='add'>+void</span>
<span class='add'>+inbound_cap_list (server *serv, char *nick, char *extensions,</span>
<span class='add'>+						const message_tags_data *tags_data)</span>
<span class='add'>+{</span>
<span class='add'>+	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, serv-&gt;server_session, nick, extensions,</span>
<span class='add'>+								  NULL, NULL, 0, tags_data-&gt;timestamp);</span>
<span class='add'>+}</span>
<span class='head'>diff --git a/src/common/inbound.h b/src/common/inbound.h
index 19820e78..5525f3ff 100644
--- a/<a href='/git-repos/torxchat.git/tree/src/common/inbound.h?id=6a0240aa181656dff00e664fd8cc60931b618a50'>src/common/inbound.h</a>
+++ b/<a href='/git-repos/torxchat.git/tree/src/common/inbound.h?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/inbound.h</a>
</span><span class='hunk'>@@ -73,8 +73,15 @@ void inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,</span>
<span class='ctx'> void inbound_action (session *sess, char *chan, char *from, char *ip, char *text, int fromme, int id);</span>
<span class='ctx'> void inbound_newnick (server *serv, char *nick, char *newnick, int quiet,</span>
<span class='ctx'> 							 const message_tags_data *tags_data);</span>
<span class='del'>-void do_dns (session *sess, char *nick, char *host);</span>
<span class='ctx'> void inbound_identified (server *serv);</span>
<span class='add'>+void inbound_cap_ack (server *serv, char *nick, char *extensions,</span>
<span class='add'>+							 const message_tags_data *tags_data);</span>
<span class='add'>+void inbound_cap_ls (server *serv, char *nick, char *extensions,</span>
<span class='add'>+							const message_tags_data *tags_data);</span>
<span class='add'>+void inbound_cap_nak (server *serv, const message_tags_data *tags_data);</span>
<span class='add'>+void inbound_cap_list (server *serv, char *nick, char *extensions,</span>
<span class='add'>+							  const message_tags_data *tags_data);</span>
<span class='add'>+void do_dns (session *sess, char *nick, char *host);</span>
<span class='ctx'> gboolean alert_match_word (char *word, char *masks);</span>
<span class='ctx'> gboolean alert_match_text (char *text, char *masks);</span>
<span class='ctx'> </span>
<span class='head'>diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 4b8c755c..72c73417 100644
--- a/<a href='/git-repos/torxchat.git/tree/src/common/proto-irc.c?id=6a0240aa181656dff00e664fd8cc60931b618a50'>src/common/proto-irc.c</a>
+++ b/<a href='/git-repos/torxchat.git/tree/src/common/proto-irc.c?id=a01bd83c64b76da028d3c23b743a61bbbc62a2d2'>src/common/proto-irc.c</a>
</span><span class='hunk'>@@ -1216,10 +1216,6 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],</span>
<span class='ctx'> 	else if (len == 3)</span>
<span class='ctx'> 	{</span>
<span class='ctx'> 		guint32 t;</span>
<span class='del'>-		guint32 want_cap;		/* format the CAP REQ string based on previous capabilities being requested or not */</span>
<span class='del'>-		guint32 want_sasl;		/* CAP END shouldn't be sent when SASL is requested, it needs further responses */</span>
<span class='del'>-		char *pass;				/* buffer for SASL password */</span>
<span class='del'>-		char buffer[256];		/* buffer for requesting capabilities and emitting the signal */</span>
<span class='ctx'> </span>
<span class='ctx'> 		t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);</span>
<span class='ctx'> 		switch (t)</span>
<span class='hunk'>@@ -1227,128 +1223,25 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],</span>
<span class='ctx'> 			case WORDL('C','A','P','\0'):</span>
<span class='ctx'> 				if (strncasecmp (word[4], "ACK", 3) == 0)</span>
<span class='ctx'> 				{</span>
<span class='del'>-					EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, sess-&gt;server-&gt;server_session,</span>
<span class='del'>-												  word[1], word[5][0]==':' ? ++word_eol[5] : word_eol[5],</span>
<span class='del'>-												  NULL, NULL, 0,</span>
<span class='del'>-												  tags_data-&gt;timestamp);</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "identify-msg") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_idmsg = TRUE;</span>
<span class='del'>-					}</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "multi-prefix") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_namesx = TRUE;</span>
<span class='del'>-					}</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "away-notify") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_awaynotify = TRUE;</span>
<span class='del'>-					}</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "account-notify") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_accnotify = TRUE;</span>
<span class='del'>-					}</span>
<span class='del'>-					</span>
<span class='del'>-					if (strstr (word_eol[5], "extended-join") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_extjoin = TRUE;</span>
<span class='del'>-					}</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "sasl") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						serv-&gt;have_sasl = TRUE;</span>
<span class='del'>-						EMIT_SIGNAL_TIMESTAMP</span>
<span class='del'>-						(</span>
<span class='del'>-							XP_TE_SASLAUTH,</span>
<span class='del'>-							serv-&gt;server_session,</span>
<span class='del'>-							(((ircnet *)sess-&gt;server-&gt;network)-&gt;user) ? (((ircnet *)sess-&gt;server-&gt;network)-&gt;user) : prefs.hex_irc_user_name,</span>
<span class='del'>-							NULL,</span>
<span class='del'>-							NULL,</span>
<span class='del'>-							NULL,</span>
<span class='del'>-							0,</span>
<span class='del'>-							tags_data-&gt;timestamp</span>
<span class='del'>-						);</span>
<span class='del'>-						tcp_send_len (serv, "AUTHENTICATE PLAIN\r\n", 20);</span>
<span class='del'>-</span>
<span class='del'>-						pass = encode_sasl_pass</span>
<span class='del'>-						(</span>
<span class='del'>-							(((ircnet *)sess-&gt;server-&gt;network)-&gt;user) ? (((ircnet *)sess-&gt;server-&gt;network)-&gt;user) : prefs.hex_irc_user_name,</span>
<span class='del'>-							sess-&gt;server-&gt;password</span>
<span class='del'>-						);</span>
<span class='del'>-						tcp_sendf (sess-&gt;server, "AUTHENTICATE %s\r\n", pass);</span>
<span class='del'>-						free (pass);</span>
<span class='del'>-					}</span>
<span class='add'>+					inbound_cap_ack (serv, word[1], </span>
<span class='add'>+										  word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],</span>
<span class='add'>+										  tags_data);</span>
<span class='ctx'> 				}</span>
<span class='ctx'> 				else if (strncasecmp (word[4], "LS", 2) == 0)</span>
<span class='ctx'> 				{</span>
<span class='del'>-					EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPLIST, serv-&gt;server_session, word[1],</span>
<span class='del'>-												  word[5][0]==':' ? ++word_eol[5] : word_eol[5],</span>
<span class='del'>-												  NULL, NULL, 0,</span>
<span class='del'>-												  tags_data-&gt;timestamp);</span>
<span class='del'>-					want_cap = 0;</span>
<span class='del'>-					want_sasl = 0;</span>
<span class='del'>-</span>
<span class='del'>-					strcpy (buffer, "CAP REQ :");</span>
<span class='del'>-</span>
<span class='del'>-					if (strstr (word_eol[5], "identify-msg") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "identify-msg ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-					if (strstr (word_eol[5], "multi-prefix") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "multi-prefix ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-					if (strstr (word_eol[5], "away-notify") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "away-notify ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-					if (strstr (word_eol[5], "account-notify") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "account-notify ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-					if (strstr (word_eol[5], "extended-join") != 0)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "extended-join ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-					/* if the SASL password is set AND auth mode is set to SASL, request SASL auth */</span>
<span class='del'>-					if (strstr (word_eol[5], "sasl") != 0 &amp;&amp; strlen (sess-&gt;server-&gt;password) != 0 &amp;&amp; serv-&gt;loginmethod == LOGIN_SASL)</span>
<span class='del'>-					{</span>
<span class='del'>-						strcat (buffer, "sasl ");</span>
<span class='del'>-						want_cap = 1;</span>
<span class='del'>-						want_sasl = 1;</span>
<span class='del'>-					}</span>
<span class='del'>-</span>
<span class='del'>-					if (want_cap)</span>
<span class='del'>-					{</span>
<span class='del'>-						/* buffer + 9 = emit buffer without "CAP REQ :" */</span>
<span class='del'>-						EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPREQ, sess-&gt;server-&gt;server_session,</span>
<span class='del'>-													  buffer + 9, NULL, NULL, NULL, 0,</span>
<span class='del'>-													  tags_data-&gt;timestamp);</span>
<span class='del'>-						tcp_sendf (serv, "%s\r\n", buffer);</span>
<span class='del'>-					}</span>
<span class='del'>-					if (!want_sasl)</span>
<span class='del'>-					{</span>
<span class='del'>-						/* if we use SASL, CAP END is dealt via raw numerics */</span>
<span class='del'>-						tcp_send_len (serv, "CAP END\r\n", 9);</span>
<span class='del'>-					}</span>
<span class='add'>+					inbound_cap_ls (serv, word[1], </span>
<span class='add'>+										 word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],</span>
<span class='add'>+										 tags_data);</span>
<span class='ctx'> 				}</span>
<span class='ctx'> 				else if (strncasecmp (word[4], "NAK", 3) == 0)</span>
<span class='ctx'> 				{</span>
<span class='del'>-					tcp_send_len (serv, "CAP END\r\n", 9);</span>
<span class='add'>+					inbound_cap_nak (serv, tags_data);</span>
<span class='ctx'> 				}</span>
<span class='ctx'> 				else if (strncasecmp (word[4], "LIST", 4) == 0)	</span>
<span class='ctx'> 				{</span>
<span class='del'>-					EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, sess-&gt;server-&gt;server_session,</span>
<span class='del'>-												  word[1], word[5][0]==':' ? ++word_eol[5] : word_eol[5],</span>
<span class='del'>-												  NULL, NULL, 0, tags_data-&gt;timestamp);</span>
<span class='add'>+					inbound_cap_list (serv, word[1], </span>
<span class='add'>+											word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],</span>
<span class='add'>+											tags_data);</span>
<span class='ctx'> 				}</span>
<span class='ctx'> </span>
<span class='ctx'> 				return;</span>
</pre></td></tr></table></div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.causal.agency/cgit-pink/about/'>cgit-pink 1.4.1</a> (<a href='https://git-scm.com/'>git 2.36.1</a>) at 2025-01-25 18:34:27 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
