2018-08-14 16:47:42 -07:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#define HAVE_IRCD_M_SELF_H
|
|
|
|
|
|
|
|
namespace ircd::m::self
|
|
|
|
{
|
2019-09-30 20:50:58 -07:00
|
|
|
// Test if provided string is one of my homeserver's network_name()'s.
|
|
|
|
bool my_host(const string_view &);
|
2018-08-17 10:37:12 -07:00
|
|
|
|
2019-09-30 20:50:58 -07:00
|
|
|
// Similar to my_host(), but the comparison is relaxed to allow port
|
|
|
|
// numbers to be a factor: myself.com:8448 input will match if a homeserver
|
2019-10-04 12:48:54 -07:00
|
|
|
// here has a network_name of myself.com.
|
2018-08-14 16:47:42 -07:00
|
|
|
bool host(const string_view &);
|
2019-06-21 16:41:43 -07:00
|
|
|
|
2019-09-30 20:50:58 -07:00
|
|
|
// Alias for origin(my()); primary homeserver's network name
|
|
|
|
string_view my_host(); //__attribute__((deprecated));
|
2018-08-14 16:47:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace ircd::m
|
|
|
|
{
|
2019-09-30 20:50:58 -07:00
|
|
|
using self::my_host;
|
|
|
|
using self::host;
|
2018-08-14 16:47:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace ircd
|
|
|
|
{
|
|
|
|
using m::my_host;
|
|
|
|
}
|