func (ss *NebStateStore) UpdateStateStore(resp *mautrix.RespSync) {
	for roomID, evts := range resp.Rooms.Join {
		room := ss.Storer.LoadRoom(roomID)
		if room == nil {
			room = mautrix.NewRoom(roomID)
			ss.Storer.SaveRoom(room)
		}
		for _, i := range evts.State.Events {
			room.UpdateState(i)
		}
		for _, i := range evts.Timeline.Events {
			if i.Type.IsState() {
				room.UpdateState(i)
			}
		}
	}
}
UpdateStateStore updates the internal state of NebStateStore from a /sync response.
package clients
import (
	"errors"
	"maunium.net/go/mautrix"
	"maunium.net/go/mautrix/event"
	"maunium.net/go/mautrix/id"
)
type NebStateStore struct {
	Storer *mautrix.InMemoryStore
}
func (ss *NebStateStore) GetEncryptionEvent(roomID id.RoomID) *event.EncryptionEventContent {
	room := ss.Storer.LoadRoom(roomID)
	if room == nil {
		return nil
	}
	if evts, ok := room.State[event.StateEncryption]; ok {
		if evt, ok := evts[""]; ok {
			return evt.Content.AsEncryption()
		}
	}
	return nil
}
func (ss *NebStateStore) IsEncrypted(roomID id.RoomID) bool {
	room := ss.Storer.LoadRoom(roomID)
	if room == nil {
		return false
	}
	_, ok := room.State[event.StateEncryption]
	return ok
}
func (ss *NebStateStore) FindSharedRooms(userID id.UserID) []id.RoomID {
	sharedRooms := make([]id.RoomID, 0)
	for roomID, room := range ss.Storer.Rooms {
		if room.GetMembershipState(userID) != event.MembershipLeave {
			sharedRooms = append(sharedRooms, roomID)
		}
	}
	return sharedRooms
}