0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-08 21:18:57 +02:00

[svn] Merge old trunk r2907,r2991:

Allow TESTLINE on channel names.
This commit is contained in:
jilles 2007-03-28 08:22:49 -07:00
parent 42bda3f3d2
commit add9f99dfa
5 changed files with 43 additions and 3 deletions

View file

@ -1,3 +1,13 @@
jilles 2007/03/28 15:04:06 UTC (20070328-3301)
Log:
Merge old trunk r2835:
resolver: if sendto(2) fails, try sending to the next nameserver
Changes: Modified:
+1 -1 trunk/src/res.c (File Modified)
jilles 2007/03/28 14:54:10 UTC (20070328-3299)
Log:
Merge old trunk r2817:

View file

@ -532,6 +532,10 @@
in use. As of charybdis 2.1.1, no_tilde and username truncation will
be taken into account like in the normal client access check.
</para>
<para>
As of charybdis 2.2.0, a channel name can be specified and the
RESV will be returned, if there is one.
</para>
</sect2>
<sect2>
<title>TESTMASK</title>

View file

@ -6,3 +6,7 @@ If nickname is specified it will also search for RESVs.
This command will not perform dns lookups on a host, for best
results you must testline a host and its IP form.
TESTLINE <#channel>
Shows whether the channel is reserved or not.

View file

@ -1 +1 @@
#define SERNO "20070328-3299"
#define SERNO "20070328-3301"

View file

@ -27,7 +27,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id: m_testline.c 2757 2006-11-10 22:58:15Z jilles $
* $Id: m_testline.c 3303 2007-03-28 15:22:49Z jilles $
*/
#include "stdinc.h"
#include "tools.h"
@ -35,6 +35,7 @@
#include "client.h"
#include "modules.h"
#include "msg.h"
#include "hash.h"
#include "hostmask.h"
#include "numeric.h"
#include "s_conf.h"
@ -54,7 +55,7 @@ struct Message testgecos_msgtab = {
};
mapi_clist_av1 testline_clist[] = { &testline_msgtab, &testgecos_msgtab, NULL };
DECLARE_MODULE_AV1(testline, NULL, NULL, testline_clist, NULL, NULL, "$Revision: 2757 $");
DECLARE_MODULE_AV1(testline, NULL, NULL, testline_clist, NULL, NULL, "$Revision: 3303 $");
static int
mo_testline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
@ -73,6 +74,27 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
mask = LOCAL_COPY(parv[1]);
if (IsChannelName(mask))
{
resv_p = hash_find_resv(mask);
if (resv_p != NULL)
{
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
resv_p->hold ? 'q' : 'Q',
resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L,
resv_p->name, resv_p->passwd);
/* this is a false positive, so make sure it isn't counted in stats q
* --nenolod
*/
resv_p->port--;
}
else
sendto_one(source_p, form_str(RPL_NOTESTLINE),
me.name, source_p->name, parv[1]);
return 0;
}
if((p = strchr(mask, '!')))
{
*p++ = '\0';