mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 11:43:57 +01:00
Prevent year 2038 problem in ChatMember
This patch changes the Type of `{Restricted,Kicked}::until_date` fields: `i32` => `i64`. This is done to fix so called "year 2038 problem" (See <https://en.wikipedia.org/wiki/Year_2038_problem>).
This commit is contained in:
parent
3522a23289
commit
23cf363271
2 changed files with 4 additions and 3 deletions
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])
|
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])
|
||||||
- `reqwest` dependency bringing `native-tls` in even when `rustls` was selected ([#71][pr71])
|
- `reqwest` dependency bringing `native-tls` in even when `rustls` was selected ([#71][pr71])
|
||||||
|
- Type of `{Restricted,Kicked}::until_date` fields: `i32` => `i64` ([#74][pr74])
|
||||||
|
|
||||||
[pr71]: https://github.com/teloxide/teloxide-core/pull/71
|
[pr71]: https://github.com/teloxide/teloxide-core/pull/71
|
||||||
[pr73]: https://github.com/teloxide/teloxide-core/pull/73
|
[pr73]: https://github.com/teloxide/teloxide-core/pull/73
|
||||||
|
|
|
@ -104,7 +104,7 @@ pub struct Administrator {
|
||||||
pub struct Restricted {
|
pub struct Restricted {
|
||||||
/// Date when restrictions will be lifted for
|
/// Date when restrictions will be lifted for
|
||||||
/// this user, unix time.
|
/// this user, unix time.
|
||||||
pub until_date: i32,
|
pub until_date: i64,
|
||||||
|
|
||||||
/// `true`, if the user can send text messages,
|
/// `true`, if the user can send text messages,
|
||||||
/// contacts, locations and venues.
|
/// contacts, locations and venues.
|
||||||
|
@ -129,7 +129,7 @@ pub struct Restricted {
|
||||||
pub struct Kicked {
|
pub struct Kicked {
|
||||||
/// Date when restrictions will be lifted for
|
/// Date when restrictions will be lifted for
|
||||||
/// this user, unix time.
|
/// this user, unix time.
|
||||||
pub until_date: i32,
|
pub until_date: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This allows calling [`ChatMemberKind`]'s methods directly on [`ChatMember`]
|
/// This allows calling [`ChatMemberKind`]'s methods directly on [`ChatMember`]
|
||||||
|
@ -260,7 +260,7 @@ impl ChatMemberKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Getter for [`Restricted::until_date`] and [`Kicked::until_date`] fields.
|
/// Getter for [`Restricted::until_date`] and [`Kicked::until_date`] fields.
|
||||||
pub fn until_date(&self) -> Option<i32> {
|
pub fn until_date(&self) -> Option<i64> {
|
||||||
match &self {
|
match &self {
|
||||||
Self::Creator(_) | Self::Administrator(_) | Self::Member | Self::Left => None,
|
Self::Creator(_) | Self::Administrator(_) | Self::Member | Self::Left => None,
|
||||||
Self::Restricted(Restricted { until_date, .. })
|
Self::Restricted(Restricted { until_date, .. })
|
||||||
|
|
Loading…
Reference in a new issue