@@ -616,9 +616,7 @@ def register_device(self, user_id, device_id, initial_display_name, is_guest=Fal
616
616
return (device_id , access_token )
617
617
618
618
@defer .inlineCallbacks
619
- def post_registration_actions (
620
- self , user_id , auth_result , access_token , bind_email , bind_msisdn
621
- ):
619
+ def post_registration_actions (self , user_id , auth_result , access_token ):
622
620
"""A user has completed registration
623
621
624
622
Args:
@@ -627,18 +625,10 @@ def post_registration_actions(
627
625
registered user.
628
626
access_token (str|None): The access token of the newly logged in
629
627
device, or None if `inhibit_login` enabled.
630
- bind_email (bool): Whether to bind the email with the identity
631
- server.
632
- bind_msisdn (bool): Whether to bind the msisdn with the identity
633
- server.
634
628
"""
635
629
if self .hs .config .worker_app :
636
630
yield self ._post_registration_client (
637
- user_id = user_id ,
638
- auth_result = auth_result ,
639
- access_token = access_token ,
640
- bind_email = bind_email ,
641
- bind_msisdn = bind_msisdn ,
631
+ user_id = user_id , auth_result = auth_result , access_token = access_token
642
632
)
643
633
return
644
634
@@ -651,13 +641,11 @@ def post_registration_actions(
651
641
):
652
642
yield self .store .upsert_monthly_active_user (user_id )
653
643
654
- yield self ._register_email_threepid (
655
- user_id , threepid , access_token , bind_email
656
- )
644
+ yield self ._register_email_threepid (user_id , threepid , access_token )
657
645
658
646
if auth_result and LoginType .MSISDN in auth_result :
659
647
threepid = auth_result [LoginType .MSISDN ]
660
- yield self ._register_msisdn_threepid (user_id , threepid , bind_msisdn )
648
+ yield self ._register_msisdn_threepid (user_id , threepid )
661
649
662
650
if auth_result and LoginType .TERMS in auth_result :
663
651
yield self ._on_user_consented (user_id , self .hs .config .user_consent_version )
@@ -676,23 +664,19 @@ def _on_user_consented(self, user_id, consent_version):
676
664
yield self .post_consent_actions (user_id )
677
665
678
666
@defer .inlineCallbacks
679
- def _register_email_threepid (self , user_id , threepid , token , bind_email ):
667
+ def _register_email_threepid (self , user_id , threepid , token ):
680
668
"""Add an email address as a 3pid identifier
681
669
682
670
Also adds an email pusher for the email address, if configured in the
683
671
HS config
684
672
685
- Also optionally binds emails to the given user_id on the identity server
686
-
687
673
Must be called on master.
688
674
689
675
Args:
690
676
user_id (str): id of user
691
677
threepid (object): m.login.email.identity auth response
692
678
token (str|None): access_token for the user, or None if not logged
693
679
in.
694
- bind_email (bool): true if the client requested the email to be
695
- bound at the identity server
696
680
Returns:
697
681
defer.Deferred:
698
682
"""
@@ -734,28 +718,15 @@ def _register_email_threepid(self, user_id, threepid, token, bind_email):
734
718
data = {},
735
719
)
736
720
737
- if bind_email :
738
- logger .info ("bind_email specified: binding" )
739
- logger .debug ("Binding emails %s to %s" % (threepid , user_id ))
740
- yield self .identity_handler .bind_threepid (
741
- threepid ["threepid_creds" ], user_id
742
- )
743
- else :
744
- logger .info ("bind_email not specified: not binding email" )
745
-
746
721
@defer .inlineCallbacks
747
- def _register_msisdn_threepid (self , user_id , threepid , bind_msisdn ):
722
+ def _register_msisdn_threepid (self , user_id , threepid ):
748
723
"""Add a phone number as a 3pid identifier
749
724
750
- Also optionally binds msisdn to the given user_id on the identity server
751
-
752
725
Must be called on master.
753
726
754
727
Args:
755
728
user_id (str): id of user
756
729
threepid (object): m.login.msisdn auth response
757
- bind_msisdn (bool): true if the client requested the msisdn to be
758
- bound at the identity server
759
730
Returns:
760
731
defer.Deferred:
761
732
"""
@@ -771,12 +742,3 @@ def _register_msisdn_threepid(self, user_id, threepid, bind_msisdn):
771
742
yield self ._auth_handler .add_threepid (
772
743
user_id , threepid ["medium" ], threepid ["address" ], threepid ["validated_at" ]
773
744
)
774
-
775
- if bind_msisdn :
776
- logger .info ("bind_msisdn specified: binding" )
777
- logger .debug ("Binding msisdn %s to %s" , threepid , user_id )
778
- yield self .identity_handler .bind_threepid (
779
- threepid ["threepid_creds" ], user_id
780
- )
781
- else :
782
- logger .info ("bind_msisdn not specified: not binding msisdn" )
0 commit comments