Compare commits
No commits in common. "6623dd46c0aed3961c001a9abc2896d1e3f1a880" and "f47bcd3f0c9d7843264900484473866282745c93" have entirely different histories.
6623dd46c0
...
f47bcd3f0c
@ -66,7 +66,7 @@ async def login(evt: CommandEvent) -> None:
|
|||||||
"action": "Login",
|
"action": "Login",
|
||||||
"room_id": evt.room_id,
|
"room_id": evt.room_id,
|
||||||
"next": enter_password,
|
"next": enter_password,
|
||||||
"email": email,
|
"email": evt.args[0],
|
||||||
}
|
}
|
||||||
|
|
||||||
""" TODO Implement web login
|
""" TODO Implement web login
|
||||||
|
@ -65,15 +65,13 @@ async def whoami(evt: CommandEvent) -> None:
|
|||||||
own_info = None
|
own_info = None
|
||||||
except CommandException as e:
|
except CommandException as e:
|
||||||
await evt.reply(f"Error from KakaoTalk: {e}")
|
await evt.reply(f"Error from KakaoTalk: {e}")
|
||||||
return
|
|
||||||
if own_info:
|
if own_info:
|
||||||
uuid = f"`{own_info.more.uuid}` ({'' if own_info.more.uuidSearchable else 'not '}searchable)" if own_info.more.uuid else "_none_"
|
|
||||||
await evt.reply(
|
await evt.reply(
|
||||||
f"You're logged in as **{own_info.more.nickName}** (KakaoTalk ID: {uuid}, internal ID: `{evt.sender.ktid}`)"
|
f"You're logged in as `{own_info.more.uuid}` (nickname: {own_info.more.nickName}, user ID: {evt.sender.ktid})."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await evt.reply(
|
await evt.reply(
|
||||||
f"You're logged in, but the bridge is unable to retrieve your profile information (internal ID: {evt.sender.ktid})"
|
f"You're logged in, but the bridge is unable to retrieve your profile information (user ID: {evt.sender.ktid})."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +94,7 @@ async def ping(evt: CommandEvent) -> None:
|
|||||||
management_only=True,
|
management_only=True,
|
||||||
help_section=SECTION_CONNECTION,
|
help_section=SECTION_CONNECTION,
|
||||||
help_text="(Re)connect to KakaoTalk chats & sync any missed chat updates",
|
help_text="(Re)connect to KakaoTalk chats & sync any missed chat updates",
|
||||||
help_args="[_number of channels to sync_]",
|
help_args="[number_of_channels_to_sync]",
|
||||||
)
|
)
|
||||||
async def sync(evt: CommandEvent) -> None:
|
async def sync(evt: CommandEvent) -> None:
|
||||||
try:
|
try:
|
||||||
@ -104,7 +102,7 @@ async def sync(evt: CommandEvent) -> None:
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
sync_count = None
|
sync_count = None
|
||||||
except ValueError:
|
except ValueError:
|
||||||
await evt.reply("The number of channels to sync must either be an integer, or be left unspecified.")
|
await evt.reply("**Usage:** `sync [number_of_channels_to_sync]`")
|
||||||
return
|
return
|
||||||
|
|
||||||
await evt.mark_read()
|
await evt.mark_read()
|
||||||
|
@ -32,6 +32,7 @@ __all__ = [
|
|||||||
"init",
|
"init",
|
||||||
"Message",
|
"Message",
|
||||||
"Portal",
|
"Portal",
|
||||||
|
"ThreadType",
|
||||||
"Puppet",
|
"Puppet",
|
||||||
"User",
|
"User",
|
||||||
]
|
]
|
||||||
|
@ -93,7 +93,9 @@ bridge:
|
|||||||
# {userid} is replaced with the user ID of the KakaoTalk user.
|
# {userid} is replaced with the user ID of the KakaoTalk user.
|
||||||
username_template: "kakaotalk_{userid}"
|
username_template: "kakaotalk_{userid}"
|
||||||
# Displayname template for KakaoTalk users.
|
# Displayname template for KakaoTalk users.
|
||||||
# {displayname} is replaced with the display name of the KakaoTalk user.
|
# {displayname} is replaced with the display name of the KakaoTalk user
|
||||||
|
# as defined below in displayname_preference.
|
||||||
|
# Keys available for displayname_preference are also available here.
|
||||||
displayname_template: "{displayname} (KT)"
|
displayname_template: "{displayname} (KT)"
|
||||||
|
|
||||||
# The prefix for commands. Only required in non-management rooms.
|
# The prefix for commands. Only required in non-management rooms.
|
||||||
|
@ -135,7 +135,7 @@ class User(DBUser, BaseUser):
|
|||||||
self._is_connected = None
|
self._is_connected = None
|
||||||
self._connection_time = time.monotonic()
|
self._connection_time = time.monotonic()
|
||||||
self._sync_lock = SimpleLock(
|
self._sync_lock = SimpleLock(
|
||||||
"Waiting for channel sync to finish before handling %s", log=self.log
|
"Waiting for thread sync to finish before handling %s", log=self.log
|
||||||
)
|
)
|
||||||
self._is_rpc_reconnecting = False
|
self._is_rpc_reconnecting = False
|
||||||
self._logged_in_info = None
|
self._logged_in_info = None
|
||||||
@ -348,7 +348,7 @@ class User(DBUser, BaseUser):
|
|||||||
state_event=BridgeStateEvent.TRANSIENT_DISCONNECT,
|
state_event=BridgeStateEvent.TRANSIENT_DISCONNECT,
|
||||||
)
|
)
|
||||||
await asyncio.sleep(60)
|
await asyncio.sleep(60)
|
||||||
await self.reload_session(event_id, retries - 1)
|
await self.reload_session(event_id, retries - 1, is_startup)
|
||||||
else:
|
else:
|
||||||
await self.send_bridge_notice(
|
await self.send_bridge_notice(
|
||||||
notice,
|
notice,
|
||||||
@ -685,9 +685,8 @@ class User(DBUser, BaseUser):
|
|||||||
if self.temp_disconnect_notices:
|
if self.temp_disconnect_notices:
|
||||||
await self.send_bridge_notice(
|
await self.send_bridge_notice(
|
||||||
"Disconnected from KakaoTalk: backend helper module exited. "
|
"Disconnected from KakaoTalk: backend helper module exited. "
|
||||||
"Will reconnect once the module resumes."
|
"Will reconnect once module resumes."
|
||||||
)
|
)
|
||||||
await self.push_bridge_state(BridgeStateEvent.TRANSIENT_DISCONNECT)
|
|
||||||
self._is_rpc_reconnecting = True
|
self._is_rpc_reconnecting = True
|
||||||
asyncio.create_task(self.reload_session())
|
asyncio.create_task(self.reload_session())
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ export default class PeerClient {
|
|||||||
const oAuthClient = await OAuthApiClient.create()
|
const oAuthClient = await OAuthApiClient.create()
|
||||||
const res = await oAuthClient.renew(req.oauth_credential)
|
const res = await oAuthClient.renew(req.oauth_credential)
|
||||||
if (res.success && userClient) {
|
if (res.success && userClient) {
|
||||||
await userClient.setCredential(res.result.credential)
|
await userClient.setCredential(res.result)
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user