aboutsummaryrefslogtreecommitdiff
path: root/telegram/cache
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-07 03:04:49 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-07 03:04:49 +0300
commit9377d7a15538a6c0af97937806ecd55eb112beb3 (patch)
treec9bad96394b4b67c23268d8355eb066c73ae7a69 /telegram/cache
parentc03ccfdfb713d4fcb089600d9fd91f03e469daca (diff)
Save/read unavailable presence type in cachev1.7.5
Diffstat (limited to 'telegram/cache')
-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
+}