From 69c1532eaebfedcd369e1d7271621b4f5e350e8f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 14 Oct 2018 17:17:50 +0200 Subject: [PATCH] Rename LastSeen to UserStatus It will make more sense later on when I add UserStatus updates handler. --- compiler/api/compiler.py | 2 +- pyrogram/__init__.py | 2 +- pyrogram/client/ext/utils.py | 4 ++-- pyrogram/client/types/__init__.py | 2 +- pyrogram/client/types/user_and_chats/__init__.py | 2 +- .../types/user_and_chats/{last_seen.py => user_status.py} | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename pyrogram/client/types/user_and_chats/{last_seen.py => user_status.py} (98%) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index 4cce310a..cacd9342 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -506,7 +506,7 @@ def start(): f.write("\n 0xb0700028: \"pyrogram.client.types.Dialog\",") f.write("\n 0xb0700029: \"pyrogram.client.types.Dialogs\",") f.write("\n 0xb0700030: \"pyrogram.client.types.ChatMembers\",") - f.write("\n 0xb0700031: \"pyrogram.client.types.LastSeen\"") + f.write("\n 0xb0700031: \"pyrogram.client.types.UserStatus\"") f.write("\n}\n") diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index cc6e9899..1f717a84 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -29,7 +29,7 @@ from .api.errors import Error from .client.types import ( Audio, Chat, ChatMember, ChatMembers, ChatPhoto, Contact, Document, InputMediaPhoto, InputMediaVideo, InputMediaDocument, InputMediaAudio, InputMediaAnimation, InputPhoneContact, - Location, Message, MessageEntity, Dialog, Dialogs, Photo, PhotoSize, Sticker, Update, User, LastSeen, + Location, Message, MessageEntity, Dialog, Dialogs, Photo, PhotoSize, Sticker, Update, User, UserStatus, UserProfilePhotos, Venue, Animation, Video, VideoNote, Voice, CallbackQuery, Messages, ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove ) diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index 82322d07..5c80264b 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -129,9 +129,9 @@ def parse_chat_photo(photo): ) -def parse_last_seen(user: types.User) -> pyrogram_types.LastSeen: +def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus: status = user.status - last_seen = pyrogram_types.LastSeen() + last_seen = pyrogram_types.UserStatus() if isinstance(status, types.UserStatusOnline): last_seen.online = True diff --git a/pyrogram/client/types/__init__.py b/pyrogram/client/types/__init__.py index a4b33e40..74c97ca1 100644 --- a/pyrogram/client/types/__init__.py +++ b/pyrogram/client/types/__init__.py @@ -36,5 +36,5 @@ from .messages_and_media import ( from .update import Update from .user_and_chats import ( Chat, ChatMember, ChatMembers, ChatPhoto, - Dialog, Dialogs, User, LastSeen + Dialog, Dialogs, User, UserStatus ) diff --git a/pyrogram/client/types/user_and_chats/__init__.py b/pyrogram/client/types/user_and_chats/__init__.py index 6711ab2c..f4742d83 100644 --- a/pyrogram/client/types/user_and_chats/__init__.py +++ b/pyrogram/client/types/user_and_chats/__init__.py @@ -22,5 +22,5 @@ from .chat_members import ChatMembers from .chat_photo import ChatPhoto from .dialog import Dialog from .dialogs import Dialogs -from .last_seen import LastSeen +from .user_status import UserStatus from .user import User diff --git a/pyrogram/client/types/user_and_chats/last_seen.py b/pyrogram/client/types/user_and_chats/user_status.py similarity index 98% rename from pyrogram/client/types/user_and_chats/last_seen.py rename to pyrogram/client/types/user_and_chats/user_status.py index 7403039b..bb42dc45 100644 --- a/pyrogram/client/types/user_and_chats/last_seen.py +++ b/pyrogram/client/types/user_and_chats/user_status.py @@ -19,7 +19,7 @@ from pyrogram.api.core import Object -class LastSeen(Object): +class UserStatus(Object): """This object represents a User last seen status """