diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-09-17 06:16:09 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-09-17 06:16:09 +0300 |
commit | 9dbd487dae9b5a74981873722be685d3706ab772 (patch) | |
tree | f5d5ab8fc1718a58cd5630aa6365f624a6fdbe98 /telegram/cache/cache.go | |
parent | 7eaf28ad7c4d2bdf5aa6313503d751de90a6811c (diff) | |
parent | 282a6fc21b9626ab1bdc9c5a78162d90b7d28aa2 (diff) |
Merge branch 'master' into muc
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 +} |