Exemplo n.º 1
0
    def fromProtocolTreeNode(node):
        entity = OutgoingReceiptProtocolEntity.fromProtocolTreeNode(node)
        entity.__class__ = RetryOutgoingReceiptProtocolEntity
        retryNode = node.getChild("retry")
        entity.setRetryData(ResultGetKeysIqProtocolEntity._bytesToInt(node.getChild("registration").data), retryNode["v"], retryNode["count"], retryNode["t"])

        return entity
Exemplo n.º 2
0
    def toProtocolTreeNode(self):
        node = super(RetryIncomingReceiptProtocolEntity, self).toProtocolTreeNode()

        retry = ProtocolTreeNode(
            "retry", {"count": str(self.count), "id": self.getId(), "v": str(self.v), "t": str(self.retryTimestamp)}
        )
        node.addChild(retry)
        registration = ProtocolTreeNode(
            "registration", data=ResultGetKeysIqProtocolEntity._intToBytes(self.remoteRegistrationId)
        )
        node.addChild(registration)
        return node
Exemplo n.º 3
0
    def toProtocolTreeNode(self):
        node = super(RetryOutgoingReceiptProtocolEntity, self).toProtocolTreeNode()
        node.setAttribute("type", "retry")

        retryAttribs = {
            "count": str(self.count),
            "id":self.getId(),
            "v":str(self.v),
            "t":  str(self.retryTimestamp)
        }

        retry = ProtocolTreeNode("retry", retryAttribs)
        node.addChild(retry)
        registration = ProtocolTreeNode("registration", data=ResultGetKeysIqProtocolEntity._intToBytes(self.localRegistrationId))
        node.addChild(registration)
        return node
    def toProtocolTreeNode(self):
        node = super(RetryIncomingReceiptProtocolEntity,
                     self).toProtocolTreeNode()

        retry = ProtocolTreeNode(
            "retry", {
                "count": str(self.count),
                "id": self.getId(),
                "v": str(self.v),
                "t": str(self.retryTimestamp)
            })
        node.addChild(retry)
        registration = ProtocolTreeNode(
            "registration",
            data=ResultGetKeysIqProtocolEntity._intToBytes(
                self.remoteRegistrationId))
        node.addChild(registration)
        return node
Exemplo n.º 5
0
 def setRegData(self,regData):
     '''
     In axolotl layer:
     regData = self.store.getLocalRegistrationId()
     '''
     self.regData = ResultGetKeysIqProtocolEntity._intToBytes(regData)
Exemplo n.º 6
0
 def setRegData(self, regData):
     '''
     In axolotl layer:
     regData = self.store.getLocalRegistrationId()
     '''
     self.regData = ResultGetKeysIqProtocolEntity._intToBytes(regData)