// Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server
Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server
Uses an invite link to add the current user to the chat if possible . The new member will not be added until the chat state has been synchronized with the server
pub async fn join_chat_by_invite_link<C: AsRef<JoinChatByInviteLink>>(
        &self,
        join_chat_by_invite_link: C,
    ) -> RTDResult<Chat> {
        let extra = join_chat_by_invite_link.as_ref().extra().ok_or(NO_EXTRA)?;
        let signal = OBSERVER.subscribe(&extra);
        self.tdlib_client
            .send(self.get_client_id()?, join_chat_by_invite_link.as_ref())?;
        let received = signal.await;
        OBSERVER.unsubscribe(&extra);
        match received {
            Err(_) => Err(CLOSED_RECEIVER_ERROR),
            Ok(v) => match v {
                TdType::Chat(v) => Ok(v),
                TdType::Error(v) => Err(RTDError::TDLibError(v)),
                _ => {
                    log::error!("invalid response received: {:?}", v);
                    Err(INVALID_RESPONSE_ERROR)
                }
            },
        }
    }
pub async fn join_chat_by_invite_link < C : AsRef < JoinChatByInviteLink > > ( & self , join_chat_by_invite_link : C , ) -> RTDResult < Chat > { let extra = join_chat_by_invite_link . as_ref ( ) . extra ( ) . ok_or ( NO_EXTRA ) ? ; let signal = OBSERVER . subscribe ( & extra ) ; self . tdlib_client . send ( self . get_client_id ( ) ? , join_chat_by_invite_link . as_ref ( ) ) ? ; let received = signal . await ; OBSERVER . unsubscribe ( & extra ) ; match received { Err ( _ ) => Err ( CLOSED_RECEIVER_ERROR ) , Ok ( v ) => match v { TdType :: Chat ( v ) => Ok ( v ) , TdType :: Error ( v ) => Err ( RTDError :: TDLibError ( v ) ) , _ => { log :: error ! ( " " v ) ; Err ( INVALID_RESPONSE_ERROR ) } } , } }
Uses an invite link to add the current user to the chat if possible.
Uses an invite link to add the current user to the chat if possible .
&self
join_chat_by_invite_link
C