mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-01-04 07:03:13 +00:00
expose decode in content_types for apps
This commit is contained in:
parent
171bdbf0a6
commit
15a40f8eff
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -26,3 +26,6 @@
|
|||||||
url = https://github.com/narimiran/blake2.git
|
url = https://github.com/narimiran/blake2.git
|
||||||
ignore = untracked
|
ignore = untracked
|
||||||
branch = master
|
branch = master
|
||||||
|
[submodule "vendor/illwill"]
|
||||||
|
path = vendor/illwill
|
||||||
|
url = https://github.com/johnnovak/illwill.git
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import ../src/chat_sdk/client
|
|||||||
import ../src/chat_sdk/conversations
|
import ../src/chat_sdk/conversations
|
||||||
import ../src/chat_sdk/delivery/waku_client
|
import ../src/chat_sdk/delivery/waku_client
|
||||||
import ../src/chat_sdk/utils
|
import ../src/chat_sdk/utils
|
||||||
|
import ../src/chat_sdk/identity
|
||||||
|
|
||||||
import ../src/content_types/all
|
import ../src/content_types/all
|
||||||
|
|
||||||
|
|||||||
@ -38,14 +38,14 @@ proc encode*(frame: object): seq[byte] =
|
|||||||
result = Protobuf.encode(frame)
|
result = Protobuf.encode(frame)
|
||||||
|
|
||||||
|
|
||||||
# proc decode*[T: object] (bytes: seq[byte], proto: typedesc[
|
proc decode*[T: object] (bytes: seq[byte], proto: typedesc[
|
||||||
# T]): Result[T, string] =
|
T]): Result[T, string] =
|
||||||
# ## Encodes the frame into a byte sequence using Protobuf serialization.
|
## Encodes the frame into a byte sequence using Protobuf serialization.
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# result = ok(Protobuf.decode(bytes, proto))
|
result = ok(Protobuf.decode(bytes, proto))
|
||||||
# except ProtobufError as e:
|
except ProtobufError as e:
|
||||||
# result = err("Failed to decode payload: " & e.msg)
|
result = err("Failed to decode payload: " & e.msg)
|
||||||
|
|
||||||
|
|
||||||
proc toContentFrame*(frame: TextFrame): ContentFrame =
|
proc toContentFrame*(frame: TextFrame): ContentFrame =
|
||||||
|
|||||||
1
vendor/illwill
vendored
Submodule
1
vendor/illwill
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 99a120f7f69868b94f5d35ce7e21dd12535de70c
|
||||||
Loading…
x
Reference in New Issue
Block a user