Repository: tinode/chat

Issue #249: Setting Defacs to include D on {acc} is ignored
Created: 2019-06-25T05:04:19Z
Subject of the issue
I want to make it possible for P2P and group users to be able to hard delete messages in the conversation, the docs suggest that on new user creation, in the {acc} you can set a different 'defacs' to allow this.  If I try and create a new users with 'defacs' of "JRWSPAD", it's created with "JRWPA"
Also, If I manually update the database to add the 'D' (to the users table, access column), when the P2P channel is subequently created, only one user gets 'D' permission, the other doesn't.
Is this expected behaviour?  How can we allow 'D' access to P2P  for all participants?
(Good news is, after I hack the db, it seems to work as expected for groups - the 'D' gets passed to the group {sub} and if the group was created with 'D' allowed, then it's granted, but it's still not possible to set the defacs for the user with 'D' in the {acc} )
Is this a bug report of a feature request?

 Bug report
 Feature request

Your environment
Server-side

 api.tinode.co
 Your own setup:

platform: Linux/IOS
version of tinode server: v0.16.0-rc1
database backend: mysql 107



Client-side

My IOS Client

Steps to reproduce
Make a new user with {acc} and acc.desc containing defacs.auth of "JRWSPAD"
Expected behaviour
Should set the defacs in the user to "JRWSPAD"
Actual behaviour
Sets the user's access to {"Auth":"JRWPA","Anon":"N"}
Server-side log
2019/06/25 12:24:46 grpc in: acc:<id:"12346" user_id:"new" scheme:"basic" secret:"***" login:true desc:<default_acs:<auth:"JRWSPAD" > > >  9JrMSrkwV3k

Client-side log
message <ClientMsg 0x6000018c8370>: {
    acc {
      id: "12346"
      user_id: "new"
      scheme: "basic"
      secret: "***"
      login: true
      desc {
        default_acs {
          auth: "JRWSPAD"
        }
      }
    }
}

<ServerCtrl 0x6000004e3b80>: {
    id: "12346"
    code: 200
    text: "ok"
    params {
      key: "expires"
      value: "\"2019-07-09T04:48:33.811Z\""
    }
    params {
      key: "authlvl"
      value: "\"auth\""
    }
    params {
      key: "desc"
      value: "{\"created\":\"2019-06-25T04:48:33.556Z\",\"updated\":\"2019-06-25T04:48:33.556Z\",\"defacs\":{\"auth\":\"JRWPA\",\"anon\":\"N\"}}"
    }
    params {
      key: "token"
      value: "\"VjIKKP9+f12hHCRdFAABAAEAEKqomgKtKE48XVzi2bBe6K7I1zmazEZmrjLn88YqTp8=\""
    }
    params {
      key: "user"
      value: "\"usrVjIKKP9-f10\""
    }
}

Even if I hack the database to allow 'D' for both users 'defacs' when the P2P is created, one user gets
message <ClientMsg 0x6000018ec0b0>: {
    sub {
      id: "12348"
      topic: "usr5Ekpuvo9hbI"
      set_query {
        sub {
          mode: "JRWPSD"
        }
      }
      get_query {
        what: "data"
        data {
        }
      }
    }
}

<ServerCtrl 0x6000004c1180>: {
    id: "12348"
    topic: "usr5Ekpuvo9hbI"
    code: 200
    text: "ok"
    params {
      key: "acs"
      value: "{\"want\":\"JRWPA\",\"given\":\"JRWPAD\",\"mode\":\"JRWPA\"}"
    }
}

the other side gets:
message <ClientMsg 0x600000f84160>: {
    sub {
      id: "12348"
      topic: "usrVjIKKP9-f10"
      set_query {
        sub {
          mode: "JRWPSD"
        }
      }
      get_query {
        what: "data"
        data {
          since_id: 3
        }
      }
    }
}

<ServerCtrl 0x6000013a4930>: {
    id: "12348"
    topic: "usrVjIKKP9-f10"
    code: 200
    text: "ok"
    params {
      key: "acs"
      value: "{\"want\":\"JRWPA\",\"given\":\"JRWPA\",\"mode\":\"JRWPA\"}"
    }
}

Duplicate issue #356: secret chat 
Created: 2020-02-11T14:04:49Z
Subject of the issue
please add secret chat similar telegram
auto remove chat history after user read message

Feature request

Your environment
Server-side

api.tinode.co

Client-side

Tindroid: Android app
Tindroid: ios app

Closing comment (2020-02-11T14:33:20Z): Related to #249