correct message handling sync
authorVolker Birk <vb@pep-project.org>
Sun, 14 Apr 2019 17:07:03 +0200
branchsync
changeset 266f5d2e0cf3c6a
parent 265 90b64446e536
child 267 d904cc7bace5
correct message handling
test/sync_handshake.py
     1.1 --- a/test/sync_handshake.py	Sun Apr 14 16:56:19 2019 +0200
     1.2 +++ b/test/sync_handshake.py	Sun Apr 14 17:07:03 2019 +0200
     1.3 @@ -93,13 +93,19 @@
     1.4      def notifyHandshake(self, me, partner, signal):
     1.5          output("on " + device_name + " signal " + str(signal) + " for identities " + str(me.fpr) + " " +
     1.6                  str(partner.fpr))
     1.7 -        try:
     1.8 -            if options.reject:
     1.9 -                self.deliverHandshakeResult(SYNC_HANDSHAKE_REJECTED)
    1.10 -            else:
    1.11 +        if signal in (
    1.12 +                pEp.sync_handshake_signal.SYNC_NOTIFY_INIT_ADD_OTHER_DEVICE,
    1.13 +                pEp.sync_handshake_signal.SYNC_NOTIFY_INIT_ADD_OUR_DEVICE,
    1.14 +                pEp.sync_handshake_signal.SYNC_NOTIFY_INIT_FORM_GROUP
    1.15 +            ):
    1.16 +            try:
    1.17 +                if options.reject:
    1.18 +                    self.deliverHandshakeResult(SYNC_HANDSHAKE_REJECTED)
    1.19 +                else:
    1.20 +                    self.deliverHandshakeResult(SYNC_HANDSHAKE_ACCEPTED)
    1.21 +
    1.22 +            except NameError:
    1.23                  self.deliverHandshakeResult(SYNC_HANDSHAKE_ACCEPTED)
    1.24 -        except NameError:
    1.25 -            self.deliverHandshakeResult(SYNC_HANDSHAKE_ACCEPTED)
    1.26  
    1.27  
    1.28  def run(name, color=None):