aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core/stanza_attribute.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/core/stanza_attribute.vala')
-rw-r--r--xmpp-vala/src/core/stanza_attribute.vala8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmpp-vala/src/core/stanza_attribute.vala b/xmpp-vala/src/core/stanza_attribute.vala
index 3169e90e..e6887f33 100644
--- a/xmpp-vala/src/core/stanza_attribute.vala
+++ b/xmpp-vala/src/core/stanza_attribute.vala
@@ -17,6 +17,14 @@ public class StanzaAttribute : StanzaEntry {
}
}
+ public string to_ansi_string(bool hide_ns = false) {
+ if (ns_uri == null || hide_ns) {
+ return @"$name=$ANSI_COLOR_GREEN'$val'$ANSI_COLOR_END";
+ } else {
+ return @"$ANSI_COLOR_GRAY{$ns_uri}:$ANSI_COLOR_END$name=$ANSI_COLOR_GREEN'$val'$ANSI_COLOR_END";
+ }
+ }
+
public string to_xml(NamespaceState? state_) throws XmlError {
NamespaceState state = state_ ?? new NamespaceState();
if (ns_uri == state.current_ns_uri || (ns_uri == XMLNS_URI && name == "xmlns")) {