mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 03:43:11 -06:00
Unmarshal the content, that would help
This commit is contained in:
parent
07a89c4e6b
commit
7fd784034d
|
|
@ -2,6 +2,7 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -146,6 +147,9 @@ func (r *RoomserverInternalAPI) performJoinRoomByID(
|
||||||
if se.Type() == gomatrixserverlib.MRoomMember {
|
if se.Type() == gomatrixserverlib.MRoomMember {
|
||||||
if se.StateKey() != nil && *se.StateKey() == userID {
|
if se.StateKey() != nil && *se.StateKey() == userID {
|
||||||
var content map[string]interface{}
|
var content map[string]interface{}
|
||||||
|
if err = json.Unmarshal(se.Content(), &content); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if membership, ok := content["membership"]; ok {
|
if membership, ok := content["membership"]; ok {
|
||||||
alreadyJoined = (membership == "join")
|
alreadyJoined = (membership == "join")
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue