summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
Diffstat (limited to 'find.go')
-rw-r--r--find.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/find.go b/find.go
new file mode 100644
index 0000000..8f05871
--- /dev/null
+++ b/find.go
@@ -0,0 +1,24 @@
+// Copyright 2025 WIT.COM Inc Licensed GPL 3.0
+
+package chatpb
+
+func (all *Chats) FindUuid(id string) *Chat {
+ for chat := range all.IterAll() {
+ if chat.Uuid == id {
+ return chat
+ }
+
+ for _, e := range chat.GetSession() {
+ if id == e.Uuid {
+ return chat
+ }
+ }
+
+ for _, e := range chat.GetEntries() {
+ if id == e.Uuid {
+ return chat
+ }
+ }
+ }
+ return nil
+}