aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core/stanza_attribute.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-04-03 15:09:30 +0200
committerMarvin W <git@larma.de>2017-04-03 15:09:30 +0200
commit2a49d4a1aaf1d1fb644d3e4586989c696f657bcc (patch)
treec24ad367f659ba464d6130bbd3edf47483d52ce3 /xmpp-vala/src/core/stanza_attribute.vala
parent8248cfcbb25dc14c81bd9673c8b3642ce98ea495 (diff)
downloaddino-2a49d4a1aaf1d1fb644d3e4586989c696f657bcc.tar.gz
dino-2a49d4a1aaf1d1fb644d3e4586989c696f657bcc.zip
Add --print-xmpp flag to log details
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")) {