Commit graph

4055 commits

Author SHA1 Message Date
Maybe Waffle
0253979e36 update rust version 2022-12-28 23:16:00 +04:00
Maybe Waffle
1f5b242b36 Add deprecation note 2022-12-15 17:04:05 +04:00
Maybe Waffle
6f1bb4b519 revert move of storage module 2022-12-14 19:47:21 +04:00
Maybe Waffle
a366334710 Thank god we test --no-default-features in CI uhhhhh 2022-12-14 19:30:21 +04:00
Maybe Waffle
dccd3ce4c7 Add back old module paths, but deprecate then 2022-12-12 18:30:27 +04:00
Maybe Waffle
b680c087c5 Update changelog 2022-12-12 18:30:27 +04:00
Maybe Waffle
aa8be1cd15 Flatten teloxide module structure 2022-12-12 18:30:27 +04:00
Sima Kinsart
a435266e89
Merge pull request #769 from teloxide/const-must-use
More `const` and `#[must_use]` functions
2022-12-09 22:31:19 +06:00
Sima Kinsart
bb6dd81f6a
Merge branch 'dev' into const-must-use 2022-12-09 19:17:55 +06:00
Hirrolot
cde45ab8ee Remove useless const 2022-12-09 19:16:41 +06:00
Waffle Maybe
d008bfc2de
Merge pull request #790 from teloxide/fix_no_feature_test
Properly gate tests, so that `cargo test` works with any features
2022-12-08 15:11:45 +04:00
Maybe Waffle
7ea428a21c Properly gate tests, so that cargo test works with any features 2022-12-06 16:06:35 +04:00
Waffle Maybe
a84a90e038
Merge pull request #775 from teloxide/metarefactor
Refactor `Cargo.toml`s
2022-11-30 01:16:28 +04:00
Maybe Waffle
56e29611ab Remove the reasoning behind MSRV 2022-11-29 22:12:49 +04:00
Waffle Maybe
7a02bfab86
Merge pull request #785 from teloxide/changelogfm
Fix a typo in changelog
2022-11-28 23:23:18 +04:00
Maybe Waffle
dfb22450fc Refactor Cargo.tomls 2022-11-28 22:14:49 +04:00
Maybe Waffle
3c4ea18125 Fix a typo in changelog 2022-11-28 22:10:26 +04:00
Waffle Maybe
c312523375
Merge pull request #784 from TmLev/dev
Bump `axum` to `0.6.0`
2022-11-28 22:08:35 +04:00
Lev Khoroshansky
d89dfa77c1 chore: Sync changelog 2022-11-28 15:43:54 +01:00
Lev Khoroshansky
b6c27db50e fix: Adjust to axum@0.6.0 2022-11-28 15:43:09 +01:00
Lev Khoroshansky
a6d3e1e9b1 deps: Bump axum to 0.6.0 2022-11-28 15:42:12 +01:00
Waffle Maybe
15bd11ebe9
Merge pull request #782 from teloxide/master-tmp
Merge `master` into `dev`
2022-11-28 17:04:05 +04:00
Maybe Waffle
8ad3bf506b Revert "Revert "Merge branch 'dev'""
This reverts commit 4e004739ca.
2022-11-28 16:51:16 +04:00
Sima Kinsart
ff1bf7092c
Merge pull request #776 from Turbo87/fix-feature-gate
prelude: Add missing feature gate for `dispatching::repls` import
2022-11-28 18:27:15 +06:00
Hirrolot
02398e3464 Release teloxide v0.11.3 2022-11-28 16:09:57 +04:00
Hirrolot
d50370a5f9 Fix unused ctrlc_handler warning 2022-11-28 15:58:33 +04:00
Hirrolot
4e004739ca Revert "Merge branch 'dev'"
This reverts commit 4e2ebdcff7, reversing
changes made to c1c71c5b9c.
2022-11-28 16:43:32 +06:00
Hirrolot
6cc4b662ec Revert "Revert "Merge pull request #771 from Turbo87/fix-feature-gate""
This reverts commit 815a0a4d73.
2022-11-28 16:43:15 +06:00
Hirrolot
815a0a4d73 Revert "Merge pull request #771 from Turbo87/fix-feature-gate"
This reverts commit c1c71c5b9c, reversing
changes made to 2c52e2a1d4.
2022-11-28 16:40:13 +06:00
Sima Kinsart
437404df22
Check the CI with no default features 2022-11-25 16:38:34 +06:00
Waffle Maybe
582520d67f
Merge pull request #774 from teloxide/master
Merge v0.11.2 into `dev`
2022-11-23 11:45:42 +04:00
Hirrolot
4e2ebdcff7 Merge branch 'dev' 2022-11-23 13:16:55 +06:00
Tobias Bieniek
3184b294f2
prelude: Add missing feature gate for dispatching::repls import 2022-11-18 09:55:02 +01:00
Waffle Maybe
c1c71c5b9c
Merge pull request #771 from Turbo87/fix-feature-gate
Add missing feature gate for `dispatching::repls` import
2022-11-18 00:39:39 +04:00
Hirrolot
e4e741a8f9 Release teloxide v0.11.2 2022-11-18 02:22:49 +06:00
Tobias Bieniek
ec4876db8d
Add missing feature gate for dispatching::repls import 2022-11-17 10:10:56 +01:00
Hirrolot
762ab2f5e3 Make more functions #[must_use] 2022-11-17 14:54:40 +06:00
Hirrolot
7cd36d9c40 Make more functions const 2022-11-17 14:42:36 +06:00
Waffle Maybe
2ae03963c7
Merge pull request #761 from teloxide/unrock
Remove rocksdb storage
2022-11-16 17:42:12 +04:00
Maybe Waffle
7e28f8e763 Mention why rocksdb-storage was removed 2022-11-16 17:21:47 +04:00
Waffle Maybe
9095aaa839
Merge pull request #764 from Veetaha/feat/add-missing-restricted-fields
Add missing fields for `Restricted` chat member
2022-11-16 17:19:36 +04:00
Veetaha
d0b71c358e Move changelog entries into teloxide-core's changelog file 2022-11-14 23:20:50 +01:00
Veetaha
170941e797 Improve spacing 2022-11-14 23:16:07 +01:00
Veetaha
660c58c95c Update the changelog 2022-11-14 23:13:40 +01:00
Veetaha
1c6fc4aae0 Update the docs of is_present() method 2022-11-14 23:13:33 +01:00
Waffle Maybe
63b6f1841a
Merge pull request #765 from teloxide/remove_use_of_deprecated_fn
Remove use of deprecated fn
2022-11-14 22:23:55 +04:00
Maybe Waffle
5f0df0577f Remove use of deprecated chrono::NaiveDateTime::from_timestamp 2022-11-14 17:55:11 +04:00
Veetaha
c65996eb75 Update is_present() to take is_member into account 💪 2022-11-12 01:39:59 +01:00
Veetaha
30439d6d28 Add missing fields for Restricted chat member
These fields are present in the docs, and I tested it manually by calling the `get_chat_member` method with the changed `teloxide-core` code that parsing still works fine for the `Restricted` chat member.

There are however some potential logic bugs here described bellow. I fixed some of them, but others are still outstanding.

\# Logic bugs

\## Shared permission fields in `Administrator` and `Restricted`

The current code of `teloxide-core` at the time of this writing doesn't take into account the shared permission fields of `Administrator` and `Restricted` because just were no such fields in `Restricted` struct. This bug is fixed by this PR.

\## Deceiving behavior of `ChatMemberKind::Member`

The existing getter methods of `ChatMember` assume that if the `ChatMemberKind` is `Member`, then the member has all rights for all fields of `Restricted` struct.

And there is also a similar problem with `Administrator` struct.

The existing getter methods of `ChatMember` assume that if the `ChatMemberKind` is `Member`, then the member has no rights for all fields of `Administrator` struct.

This isn't always true. Regular members *may or may not have* `can_invite_users` permission, for example. This is determined by the default chat parmissions. See bellow.

\# General decieving behavior of permission getters

The default chat permissions seem to override any cofigurations of `Restricted` chat members.
For example, if the `Restricted` chat member has `can_invite_users` set to `true`, but the default chat permissions have `can_invite_users` set to `false`, then the effective `can_invite_users` permission of such a user is `false` (verified experimentally).

Therefore, the getters for the permission fields of the `ChatMember` type actually don't make sense. They don't show the effective permissions of the user. Maybe we could make that clear in their docs, but the problem is that these getters don't have enough context to decide what to return for regular `ChatMemberKind::Member`.

I am not sure how to proceed here. For example, these getters could return `Option` values, and always return `None` for `ChatMemberKind::Member`.

I didn't fix that bug in this PR, because I believe it requires a more careful consideration, larger and potentially breaking changes, that I am not ready to do.

\# Intentionally left as not in scope of this PR

Telegram added topics feature recenenty, and consequently they added `can_manage_topics` field both to `Administrator` and `Restricted` structs. This field is not present in the current code of `teloxide-core` at the time of this writing, and I think it should be added in a separate PR that covers topics API as a whole.

Also, one discrapancy with the new `can_manage_topics` field is with its type and documentation.

Here is how this field looks like in `ChatMemberAdministrator` **and** `ChatAdministratorRights`:

```
can_manage_topics	Boolean	Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
```

Here is how this field looks like in `ChatMemberRestricted`:

```
can_manage_topics	Boolean	True, if the user is allowed to create forum topics
```

Here is how this field looks like in `ChatPermissions`:

```
can_manage_topics	Boolean	Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
````

There is something subtle between the semantics of `can_manage_topics` for regular users and administrators according to the difference in their documentation. I didn't dig into that rabbit hole, so I intentionally didn't include topics feature changes in this PR.
2022-11-09 03:08:52 +01:00
Waffle Maybe
45538db820
Merge pull request #762 from manorom/message-id-display
Derive Display Trait for MessageId type
2022-11-08 22:15:02 +04:00