Compare commits

..

1 Commits

Author SHA1 Message Date
Dominic Zimmer
f052c47d09 Add more verbose error message 2019-09-20 20:03:13 +02:00
3 changed files with 27 additions and 29 deletions

View File

@ -21,17 +21,17 @@ Currently, there is no way of changing the keybindings in a config. This is subj
The default key bindings are The default key bindings are
| Key | Function | Key | Function
| ---- | ---- | --|--
| i | Enter insert mode (to compose a message) | i| Enter insert mode (to compose a message)
| y, Return | Send message | y, Return | Send message
| Esc | Cancel, Exit current mode | Esc | Cancel, Exit current mode
| c/C | Previous/Next Dialog | c/C | Previous/Next Dialog
| E | Toggle emoji ASCII display | E | Toggle emoji ASCII display
| `n` e | Edit message `n` (ESC to open prompt to save changes) | `n` e | Edit message `n` (ESC to open prompt to save changes)
| `n` r | Reply to message `n` (submit draft) | `n` r | Reply to message `n` (submit draft)
| `n` d | Delete message `n` | `n` d | Delete message `n`
| / | enter search mode | / | enter search mode
| n/N | Previous/Next search result | n/N | Previous/Next search result
| Q | exit TTTC | Q | exit TTTC
| q `r` | Record macro into register `r` | q `r` | Record macro into register `r`

View File

@ -55,10 +55,10 @@ class AuthView():
else: else:
break break
except telethon.errors.rpcerrorlist.FloodWaitError as err: except telethon.errors.rpcerrorlist.FloodWaitError as err:
self.stdscr.addstr(f"The telegram servers blocked you for too many retries ({err.seconds}s remaining). ") self.stdscr.addstr(f"The telegram servers blocked you for too many retries. ({err.seconds}s remaining).")
self.stdscr.refresh() self.stdscr.refresh()
except Exception as e: except Exception as e:
self.stdscr.addstr("Incorrect phone number. ") self.stdscr.addstr(f"An error occured: {str(e)}")
self.stdscr.refresh() self.stdscr.refresh()
self.stdscr.addstr("Now authentificate with the code telegram sent to you.") self.stdscr.addstr("Now authentificate with the code telegram sent to you.")
self.stdscr.refresh() self.stdscr.refresh()

View File

@ -89,22 +89,20 @@ class MainView():
dialog["messages"].insert(0, newmessage[0]) dialog["messages"].insert(0, newmessage[0])
if not event.out: if not event.out:
dialog["unread_count"] += 1 dialog["unread_count"] += 1
os.system(f"notify-send -i apps/telegram \"{dialog['dialog'].name}\" \"{newmessage[0].message}\"")
front = self.dialogs.pop(idx) front = self.dialogs.pop(idx)
self.dialogs = [front] + self.dialogs self.dialogs = [front] + self.dialogs
break break
#old dead code # auto adjust relative replys to match shifted message offsets
# # auto adjust relative replys to match shifted message offsets if event.chat_id == self.dialogs[self.selected_chat]["dialog"].id:
# if event.chat_id == self.dialogs[self.selected_chat]["dialog"].id: if self.inputs.startswith("r"):
# if self.inputs.startswith("r"): num = self.inputs[1:].split()[0]
# num = self.inputs[1:].split()[0] try:
# try: # num = int(s[1:].split()[0])
## num = int(s[1:].split()[0]) number = int(num)
# number = int(num) msg = self.inputs.replace("r" + num, "r" + str(number+1))
# msg = self.inputs.replace("r" + num, "r" + str(number+1)) self.inputs = msg
# self.inputs = msg except:
# except: pass
# pass
# dont switch the dialoge upon arriving messages # dont switch the dialoge upon arriving messages
if idx == self.selected_chat: if idx == self.selected_chat:
self.selected_chat = 0 self.selected_chat = 0