diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-08-07 03:04:49 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-08-07 03:04:49 +0300 |
commit | 9377d7a15538a6c0af97937806ecd55eb112beb3 (patch) | |
tree | c9bad96394b4b67c23268d8355eb066c73ae7a69 /telegram/cache | |
parent | c03ccfdfb713d4fcb089600d9fd91f03e469daca (diff) |
Save/read unavailable presence type in cachev1.7.5
Diffstat (limited to 'telegram/cache')
-rw-r--r-- | telegram/cache/cache.go | 10 |
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 +} |