diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2020-12-20 00:51:00 -0600 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2020-12-20 00:51:00 -0600 |
commit | c2c7e5afb21896c848047416219e907439f6a198 (patch) | |
tree | 07f50ea25d8ac65fd09aae8fb59284cc5e8b22cd /libpurple/network.h | |
parent | 0ed993421ab10c3981263c7e325dcb03fab1cf74 (diff) | |
download | pidgin-c2c7e5afb21896c848047416219e907439f6a198.tar.gz |
Cleanup local IP getters
* Rename `purple_network_get_my_ip` to `purple_network_discover_my_ip`.
Nothing actually cares about what it returns, so stop returning anything.
* Use libnice to replace `purple_network_get_local_system_ip`.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/296/
Diffstat (limited to 'libpurple/network.h')
-rw-r--r-- | libpurple/network.h | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/libpurple/network.h b/libpurple/network.h index c3fcfbd6fc..4a3a5e257b 100644 --- a/libpurple/network.h +++ b/libpurple/network.h @@ -63,46 +63,24 @@ void purple_network_set_public_ip(const char *ip); * Returns the IP address of the local system set in preferences. * * This returns the value set via purple_network_set_public_ip(). - * You probably want to use purple_network_get_my_ip() instead. * * Returns: The local IP address set in preferences. */ const char *purple_network_get_public_ip(void); /** - * purple_network_get_local_system_ip: + * purple_network_discover_my_ip: * - * Returns the IP address of the local system. + * Discovers the IP address that should be used anywhere a public IP addresses + * is needed (listening for an incoming file transfer, etc). * - * You probably want to use purple_network_get_my_ip() instead. - * - * Note: The returned string is a pointer to a static buffer. If this - * function is called twice, it may be important to make a copy - * of the returned string. - * - * Returns: The local IP address. - */ -const gchar *purple_network_get_local_system_ip(void); - -/** - * purple_network_get_my_ip: - * - * Returns the IP address that should be used anywhere a - * public IP addresses is needed (listening for an incoming - * file transfer, etc). - * - * If the user has manually specified an IP address via - * preferences, then this IP is returned. Otherwise the - * IP address returned by purple_network_get_local_system_ip() - * is returned. - * - * Note: The returned string is a pointer to a static buffer. If this - * function is called twice, it may be important to make a copy - * of the returned string. + * If the user has manually specified an IP address via preferences, then this + * is used. Otherwise STUN, UPnP, and NAT-PMP will be attempted to discover + * the local IP address depending on what's available. * - * Returns: The local IP address to be used. + * Since: 3.0.0 */ -const gchar *purple_network_get_my_ip(void); +void purple_network_discover_my_ip(void); /** * purple_network_get_my_ip_from_gio: @@ -112,7 +90,7 @@ const gchar *purple_network_get_my_ip(void); * needed (listening for an incoming file transfer, etc). * * If the user has manually specified an IP address via preferences, then this - * IP is returned. Otherwise STUN, UPNP, NAT-PMP, and finally GIO will be + * IP is returned. Otherwise STUN, UPnP, NAT-PMP, and finally GIO will be * attempted to discover the local IP address depending on what's available. * * Returns: The local IP address to be used. |