fix: group name when rejoining a group

This commit is contained in:
Richard Ramos 2020-06-22 09:13:14 -04:00 committed by Iuri Matias
parent 6c050bf381
commit fb60d757cf
2 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,7 @@ proc toChatMembershipEvent*(jsonMembership: JsonNode): ChatMembershipEvent =
rawPayload: jsonMembership["rawPayload"].getStr, rawPayload: jsonMembership["rawPayload"].getStr,
signature: jsonMembership["signature"].getStr, signature: jsonMembership["signature"].getStr,
eventType: jsonMembership["type"].getInt, eventType: jsonMembership["type"].getInt,
name: jsonMembership{"name"}.getStr,
members: @[] members: @[]
) )
if jsonMembership{"members"} != nil: if jsonMembership{"members"} != nil:

View File

@ -32,6 +32,7 @@ type ChatMembershipEvent* = object
chatId*: string chatId*: string
clockValue*: int64 clockValue*: int64
fromKey*: string fromKey*: string
name*: string
members*: seq[string] members*: seq[string]
rawPayload*: string rawPayload*: string
signature*: string signature*: string
@ -40,6 +41,7 @@ type ChatMembershipEvent* = object
proc toJsonNode*(self: ChatMembershipEvent): JsonNode = proc toJsonNode*(self: ChatMembershipEvent): JsonNode =
result = %* { result = %* {
"chatId": self.chatId, "chatId": self.chatId,
"name": self.name,
"clockValue": self.clockValue, "clockValue": self.clockValue,
"from": self.fromKey, "from": self.fromKey,
"members": self.members, "members": self.members,