mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Fix bug where we /always/ created a new state group
This commit is contained in:
parent
ed8b7d400c
commit
5ff0bfb81d
3 changed files with 41 additions and 30 deletions
|
@ -16,11 +16,6 @@
|
|||
from ._base import SQLBaseStore
|
||||
from twisted.internet import defer
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
StateGroup = namedtuple("StateGroup", ("group", "state"))
|
||||
|
||||
|
||||
class StateStore(SQLBaseStore):
|
||||
|
||||
|
@ -37,7 +32,7 @@ class StateStore(SQLBaseStore):
|
|||
if group:
|
||||
groups.add(group)
|
||||
|
||||
res = []
|
||||
res = {}
|
||||
for group in groups:
|
||||
state_ids = yield self._simple_select_onecol(
|
||||
table="state_groups_state",
|
||||
|
@ -53,7 +48,7 @@ class StateStore(SQLBaseStore):
|
|||
if s:
|
||||
state.append(s)
|
||||
|
||||
res.append(StateGroup(group, state))
|
||||
res[group] = state
|
||||
|
||||
defer.returnValue(res)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue