diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-08-26 15:59:14 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-08-26 15:59:14 +0300 |
commit | 8ba7596ab5b9cd731fb507f60da51c6acf1ef27f (patch) | |
tree | 91e17a6bdd70300f2d784e60a1f88d47d3ec18ad /telegram/cache/cache.go | |
parent | 3c917c16983c1afdd4a21d8021461585a1e785c9 (diff) | |
parent | 64515e2c666067953e3a9680b4f0db84f3838498 (diff) |
Merge branch 'master' into dev
Diffstat (limited to 'telegram/cache/cache.go')
-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 +} |