3 changed files with 32 additions and 15 deletions
@ -0,0 +1,22 @@
|
||||
#pragma once |
||||
|
||||
#include <QCoreApplication> |
||||
#include <QString> |
||||
#include "../../../src/routing_layer/address_profile.h" |
||||
|
||||
// Показывает результат измерения отдельно от происхождения адреса (интерфейс или NAT).
|
||||
inline QString addressProfileText(int mapping, int inbound, int source) { |
||||
if (source == ADDRESS_SOURCE_NONE) return QCoreApplication::translate("ChatGui", "NAT not determined"); |
||||
QString text; |
||||
switch (mapping) { |
||||
case ADDRESS_MAP_UNCHANGED: text = QCoreApplication::translate("ChatGui", "No NAT"); break; |
||||
case ADDRESS_MAP_EIM: text = inbound == ADDRESS_IN_UNKNOWN ? "EIM?" : "EIM"; break; |
||||
case ADDRESS_MAP_DEPENDENT: return "DEPENDENT"; |
||||
default: return "NAT?"; |
||||
} |
||||
if (inbound == ADDRESS_IN_OPEN) text += QCoreApplication::translate("ChatGui", "; inbound open"); |
||||
else if (inbound == ADDRESS_IN_CONTACT) text += QCoreApplication::translate("ChatGui", "; inbound filtered"); |
||||
else if (mapping == ADDRESS_MAP_UNCHANGED) text += QCoreApplication::translate("ChatGui", "; inbound untested"); |
||||
if (source == ADDRESS_SOURCE_STUN) text += " (STUN)"; |
||||
return text; |
||||
} |
||||
Loading…
Reference in new issue