expose decode in content_types for apps

This commit is contained in:
Jazz Turner-Baggs 2025-09-26 12:07:22 -07:00
parent 171bdbf0a6
commit 15a40f8eff
No known key found for this signature in database
4 changed files with 12 additions and 7 deletions

3
.gitmodules vendored
View File

@ -26,3 +26,6 @@
url = https://github.com/narimiran/blake2.git
ignore = untracked
branch = master
[submodule "vendor/illwill"]
path = vendor/illwill
url = https://github.com/johnnovak/illwill.git

View File

@ -6,6 +6,7 @@ import ../src/chat_sdk/client
import ../src/chat_sdk/conversations
import ../src/chat_sdk/delivery/waku_client
import ../src/chat_sdk/utils
import ../src/chat_sdk/identity
import ../src/content_types/all

View File

@ -38,14 +38,14 @@ proc encode*(frame: object): seq[byte] =
result = Protobuf.encode(frame)
# proc decode*[T: object] (bytes: seq[byte], proto: typedesc[
# T]): Result[T, string] =
# ## Encodes the frame into a byte sequence using Protobuf serialization.
proc decode*[T: object] (bytes: seq[byte], proto: typedesc[
T]): Result[T, string] =
## Encodes the frame into a byte sequence using Protobuf serialization.
# try:
# result = ok(Protobuf.decode(bytes, proto))
# except ProtobufError as e:
# result = err("Failed to decode payload: " & e.msg)
try:
result = ok(Protobuf.decode(bytes, proto))
except ProtobufError as e:
result = err("Failed to decode payload: " & e.msg)
proc toContentFrame*(frame: TextFrame): ContentFrame =

1
vendor/illwill vendored Submodule

@ -0,0 +1 @@
Subproject commit 99a120f7f69868b94f5d35ce7e21dd12535de70c