aboutsummaryrefslogtreecommitdiff
path: root/telegram/cache/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/cache/cache.go')
-rw-r--r--telegram/cache/cache.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/telegram/cache/cache.go b/telegram/cache/cache.go
index 3d9608d..6847d3e 100644
--- a/telegram/cache/cache.go
+++ b/telegram/cache/cache.go
@@ -133,3 +133,13 @@ func (cache *Cache) SetStatus(id int64, show string, status string) {
Description: status,
}
}
+
+// Destruct splits a cached status into show, description and type
+func (status *Status) Destruct() (show, description, typ string) {
+ show, description = status.XMPP, status.Description
+ if show == "unavailable" {
+ typ = show
+ show = ""
+ }
+ return
+}