Fix various typos
This commit is contained in:
parent
e8b2f6f8a1
commit
716e426933
|
@ -32,6 +32,7 @@ from .appservice import ApplicationServicesHandler
|
||||||
from .sync import SyncHandler
|
from .sync import SyncHandler
|
||||||
from .auth import AuthHandler
|
from .auth import AuthHandler
|
||||||
from .identity import IdentityHandler
|
from .identity import IdentityHandler
|
||||||
|
from .receipts import ReceiptsHandler
|
||||||
|
|
||||||
|
|
||||||
class Handlers(object):
|
class Handlers(object):
|
||||||
|
@ -57,6 +58,7 @@ class Handlers(object):
|
||||||
self.directory_handler = DirectoryHandler(hs)
|
self.directory_handler = DirectoryHandler(hs)
|
||||||
self.typing_notification_handler = TypingNotificationHandler(hs)
|
self.typing_notification_handler = TypingNotificationHandler(hs)
|
||||||
self.admin_handler = AdminHandler(hs)
|
self.admin_handler = AdminHandler(hs)
|
||||||
|
self.receipts_handler = ReceiptsHandler(hs)
|
||||||
asapi = ApplicationServiceApi(hs)
|
asapi = ApplicationServiceApi(hs)
|
||||||
self.appservice_handler = ApplicationServicesHandler(
|
self.appservice_handler = ApplicationServicesHandler(
|
||||||
hs, asapi, AppServiceScheduler(
|
hs, asapi, AppServiceScheduler(
|
||||||
|
|
|
@ -31,6 +31,8 @@ class ReceiptsHandler(BaseHandler):
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
super(ReceiptsHandler, self).__init__(hs)
|
super(ReceiptsHandler, self).__init__(hs)
|
||||||
|
|
||||||
|
self.hs = hs
|
||||||
|
self.federation = hs.get_replication_layer()
|
||||||
self.federation.register_edu_handler(
|
self.federation.register_edu_handler(
|
||||||
"m.receipt", self._received_remote_receipt
|
"m.receipt", self._received_remote_receipt
|
||||||
)
|
)
|
||||||
|
@ -89,13 +91,13 @@ class ReceiptsHandler(BaseHandler):
|
||||||
|
|
||||||
with PreserveLoggingContext():
|
with PreserveLoggingContext():
|
||||||
self.notifier.on_new_event(
|
self.notifier.on_new_event(
|
||||||
"recei[t_key", self._latest_serial, rooms=[room_id]
|
"receipt_key", self._latest_serial, rooms=[room_id]
|
||||||
)
|
)
|
||||||
|
|
||||||
localusers = set()
|
localusers = set()
|
||||||
remotedomains = set()
|
remotedomains = set()
|
||||||
|
|
||||||
rm_handler = self.homeserver.get_handlers().room_member_handler
|
rm_handler = self.hs.get_handlers().room_member_handler
|
||||||
yield rm_handler.fetch_room_distributions_into(
|
yield rm_handler.fetch_room_distributions_into(
|
||||||
room_id, localusers=localusers, remotedomains=remotedomains
|
room_id, localusers=localusers, remotedomains=remotedomains
|
||||||
)
|
)
|
||||||
|
|
|
@ -38,6 +38,8 @@ from .state import StateStore
|
||||||
from .signatures import SignatureStore
|
from .signatures import SignatureStore
|
||||||
from .filtering import FilteringStore
|
from .filtering import FilteringStore
|
||||||
|
|
||||||
|
from .receipts import ReceiptsStore
|
||||||
|
|
||||||
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import imp
|
import imp
|
||||||
|
@ -74,6 +76,7 @@ class DataStore(RoomMemberStore, RoomStore,
|
||||||
PushRuleStore,
|
PushRuleStore,
|
||||||
ApplicationServiceTransactionStore,
|
ApplicationServiceTransactionStore,
|
||||||
EventsStore,
|
EventsStore,
|
||||||
|
ReceiptsStore,
|
||||||
):
|
):
|
||||||
|
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
|
|
|
@ -18,7 +18,7 @@ from ._base import SQLBaseStore, cached
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
|
||||||
class ReceiptStore(SQLBaseStore):
|
class ReceiptsStore(SQLBaseStore):
|
||||||
|
|
||||||
@cached
|
@cached
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
@ -77,6 +77,7 @@ class ReceiptStore(SQLBaseStore):
|
||||||
txn,
|
txn,
|
||||||
table="receipts_linearized",
|
table="receipts_linearized",
|
||||||
values={
|
values={
|
||||||
|
"stream_id": stream_id,
|
||||||
"room_id": room_id,
|
"room_id": room_id,
|
||||||
"receipt_type": receipt_type,
|
"receipt_type": receipt_type,
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
|
@ -109,16 +110,16 @@ class ReceiptStore(SQLBaseStore):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
linearized_event_id = yield self.runInteraction(
|
linearized_event_id = yield self.runInteraction(
|
||||||
graph_to_linear, desc="insert_receipt_conv"
|
"insert_receipt_conv", graph_to_linear
|
||||||
)
|
)
|
||||||
|
|
||||||
stream_id_manager = yield self._stream_id_gen.get_next(self)
|
stream_id_manager = yield self._receipts_id_gen.get_next(self)
|
||||||
with stream_id_manager() as stream_id:
|
with stream_id_manager as stream_id:
|
||||||
yield self.runInteraction(
|
yield self.runInteraction(
|
||||||
|
"insert_linearized_receipt",
|
||||||
self.insert_linearized_receipt_txn,
|
self.insert_linearized_receipt_txn,
|
||||||
room_id, receipt_type, user_id, linearized_event_id,
|
room_id, receipt_type, user_id, linearized_event_id,
|
||||||
stream_id=stream_id,
|
stream_id=stream_id,
|
||||||
desc="insert_linearized_receipt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
yield self.insert_graph_receipt(
|
yield self.insert_graph_receipt(
|
||||||
|
@ -131,9 +132,9 @@ class ReceiptStore(SQLBaseStore):
|
||||||
def insert_graph_receipt(self, room_id, receipt_type,
|
def insert_graph_receipt(self, room_id, receipt_type,
|
||||||
user_id, event_ids):
|
user_id, event_ids):
|
||||||
return self.runInteraction(
|
return self.runInteraction(
|
||||||
|
"insert_graph_receipt",
|
||||||
self.insert_graph_receipt_txn,
|
self.insert_graph_receipt_txn,
|
||||||
room_id, receipt_type, user_id, event_ids,
|
room_id, receipt_type, user_id, event_ids,
|
||||||
desc="insert_graph_receipt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def insert_graph_receipt_txn(self, txn, room_id, receipt_type,
|
def insert_graph_receipt_txn(self, txn, room_id, receipt_type,
|
||||||
|
|
Loading…
Reference in New Issue