1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-12 03:55:01 -05:00
Commit Graph

125 Commits

Author SHA1 Message Date
Steven Luo
66006cabf5 Work around a crash on ICS when destroying a ConversationActivity
On Ice Cream Sandwich, something -- possibly even in the Android
framework classes (not in our code) -- is passing in null to a
MessageListAdapter's unregisterOnDataSetObserver(), which causes a
crash.

We should really find out whether this is something we can properly fix
or not, but in the meantime, wrap the superclass's method with our own
method which checks for null before calling through to the superclass
implementation.
2011-11-26 19:41:06 +01:00
Jonas Häggqvist
61e1681b03 Proper case insensitive nick completion (untested) 2011-11-18 13:48:41 +01:00
Francesco Lavra
0a8e75feff Add /back command (issue #89)
This patch adds the /back command, which turns off the away status.
This should close issue #89, https://github.com/pocmo/Yaaic/issues/89.
2011-09-05 08:41:55 +02:00
Steven Luo
e07d99ed5d Remove views from DeckAdapter when corresponding conversation has gone missing
If a conversation disappears while the activity is paused (e.g. if the
user is kicked from a channel, or if another client attached to an
irssi-proxy has chosen to leave that channel), we currently aren't
removing the view from the DeckAdapter when we resume.  This results in
leaking a Conversation object until the user explicitly asks for the
conversation to be closed or the activity finishes, and is also
confusing because the user may not receive any indication that the
channel was parted in the first place.

There's a good case for leaving the MessageListView in place, with a
note indicating that the user has been kicked or parted from the
channel, but for that to work, we need to keep the Conversation object
in the server's list of conversations -- otherwise the behavior will
differ depending on whether the user left the activity via the Back
button or the Home button, which is counterintuitive.

For now, just remove the stale view from the DeckAdapter, which fixes
the leak and the potential user confusion.
2011-08-16 11:21:43 +02:00
Steven Luo
f84369bc19 Add new conversations to DeckAdapter in onResume()
Currently, when the user opens a ConversationActivity, goes off to do
something else without closing it, and then comes back to the activity,
conversations started since the ConversationActivity was paused (e.g. by
an incoming private message) will not appear in the ConversationGallery;
this is because we never check for new conversations in the onResume()
path.

Fortunately, this is an easy fix: we're already looping over all the
conversations in onResume() in order to add new messages to the
MessageListViews, so just look out for the new conversations and add
them to the ConversationGallery when we see them.
2011-08-16 11:21:40 +02:00
Steven Luo
c8266fbe62 Add method to remove conversation from DeckAdapter by position
This makes the following patch to remove old conversations much more
efficient.
2011-08-16 11:21:38 +02:00
Steven Luo
fafbe1ca4a Display "Not connected" in notification instead of no text when not connected 2011-08-16 11:21:33 +02:00
Sebastian Kaspari
4396e66954 Bugfix: On updating an existing server configuration the real name was overwritten by the nick name 2011-07-17 16:07:24 +02:00
Sebastian Kaspari
a357c42477 IRCService: suppress rawtype warning 2011-07-17 14:40:19 +02:00
Steven Luo
02316ffdbc Remove bottom padding in MessageListView onCreate()
If we're going to do this when changing to/from switched mode, we should
do it when creating a new MessageListView too.
2011-07-03 14:08:28 +02:00
Steven Luo
ec17d34e4d Miscellaneous ConversationLayout cleanups
* Simplify control flow in onMeasure() by moving height adjusting to
  a separate method
* Various whitespace changes and comment updates
2011-07-03 14:06:41 +02:00
Steven Luo
e0f90768b2 Remove bogus setImeOptions() in ConversationActivity
I thought this was removed when we moved the setImeOptions() further
down in onCreate(), but it's still here somehow.  This causes the Send
key on the keyboard to disappear when fullscreen IMEs are disabled.
2011-07-03 14:06:19 +02:00
Steven Luo
d80f4133f1 Ack new mentions on part or kick from a channel
If we don't do this, the user is left with a new message notification
she can't clear, and we leak the Channel object.
2011-07-03 14:03:41 +02:00
Darren Salt
2759b00084 Add an informational message for when the MOTD is ignored. 2011-07-02 19:51:32 +02:00
Darren Salt
23ca120f0e Only ignore the MOTD once. 2011-07-02 19:49:19 +02:00
Sebastian Kaspari
a6da4970aa ConversationSwitcher: Update comment 2011-07-02 19:49:19 +02:00
Sebastian Kaspari
d7070c84cf Shrinked version of Base64 class. Fixes #71. 2011-07-02 19:49:18 +02:00
Sebastian Kaspari
61252c7535 Remove unused imports 2011-07-02 19:49:18 +02:00
Rey Rey
2e2aebf2c4 Micro optimized full screen code. Made starvation mode leaner.
Conflicts:

	application/src/org/yaaic/activity/ConversationActivity.java
2011-07-02 19:49:16 +02:00
Rey Rey
5c48724425 Future proofed ime no extract support, enhanced performance of fullscreen patch.
Conflicts:

	application/src/org/yaaic/activity/ConversationActivity.java
2011-07-02 19:49:10 +02:00
Rey Rey
f7ccd50227 Whitespace clean up and light refactoring
Conflicts:

	application/src/org/yaaic/activity/ConversationActivity.java
2011-07-02 19:49:06 +02:00
Rey Rey
84ade9fae4 Finalized fullscreen implementation, added heuristics to resizing, fixed ime extract bug introduced 2 commits ago.
Conflicts:

	application/src/org/yaaic/activity/ConversationActivity.java
2011-07-02 19:48:58 +02:00
Rey Rey
27d93ebaa7 Added large ime option, Extended Español support, rephrased fullscreen methodology 2011-07-02 17:55:54 +02:00
Steven Luo
ccaf9f59c4 Resize the fullscreen conversation window when IME appears instead of scrolling
When an activity sets FLAG_FULLSCREEN on its window, Android assumes
that the window size will always be the same as the screen size.  This
causes the window to scroll instead of resizing when the soft keyboard
comes up, which (according to a quick Google search) isn't the behavior
most developers are expecting.

This patch implements an ugly workaround: extend the root element of the
layout (in our case, a LinearLayout) to hook into the onMeasure()
callback, which is called when the window size changes, so that we can
resize ourselves when the window size changes.
2011-07-02 17:53:41 +02:00
Steven Luo
77dec6249d Make sure a Send button is available in landscape when ImeExtract is disabled 2011-07-02 17:53:37 +02:00
Rey Rey
6da6a7b76b Added large ime option, Extended Español support, rephrased fullscreen methodology 2011-07-02 17:53:34 +02:00
Rey Rey
93e77ea6ed Fullscreen chat implementation. pans window instead of resizing, not easly fixable 2011-07-02 17:50:02 +02:00
Rey Rey
750df0de36 Extended IRC URI support and added Yaaic IRC link to about. 2011-07-02 17:47:36 +02:00
Steven Luo
bce2523f98 Fix auto-reconnect
The current auto-reconnection implementation will only try reconnecting
once, immediately after the server is disconnected.  This will of course
almost always fail if the network is down or otherwise unavailable, so
as it stands, enabling auto-reconnect isn't particularly useful.

This patch implements multiple retries for auto-reconnect, with the
frequency of retries controlled by a preference.  The Android alarm
infrastructure is used to schedule reconnection attempts; if the phone
misses a scheduled attempt while it's asleep, the reconnection will be
attempted the next time the phone wakes up.
2011-06-29 20:34:55 +02:00
Steven Luo
e7651315df Make reconnections actually work
At the moment, the reconnect feature is somewhat glitchy, popping up
multiple reconnect prompts even if a reconnection succeeds, and
occasionally causing crashes.  A successful reconnection results in the
conversation history being cleared, which is an annoying outcome when
connected over an unreliable network.

This patch does the following:

* Keep track of whether a reconnect dialog is active, to prevent
  multiple dialogs from opening.
* Introduce a new field to the Server object, mayReconnect, which is
  used to keep track of whether a reconnection should be attempted in
  the event of a disconnection.  It's set to "true" when we connect to a
  server, and "false" if the user asks for a disconnection.
* Prevent the clearing of active conversations and conversation history
  on disconnect, unless the user specifically asked for the disconnect.
* Keep the IRCService running even when no servers are connected, unless
  the user has disconnected from all servers herself.  This is needed
  for reliable auto-reconnects (see next patch), but has the side effect
  of keeping conversation history around even if the activity isn't open
  when a disconnect happens.
2011-06-29 20:34:52 +02:00
Steven Luo
a69fafc4dd PircBot: Gracefully handle disposing of the PircBot before I/O threads are started 2011-06-29 20:34:50 +02:00
Sebastian Kaspari
ae871f8a1f AddChannelActivity: Always set cursor at the end of the input field 2011-06-13 22:48:25 +02:00
Sebastian Kaspari
6e48a29b34 Display message at the beginning and end of the server login 2011-06-10 22:29:17 +02:00
Sebastian Kaspari
2f19eb8032 (Authentication) Implementation of authentication via SASL on connect 2011-06-10 22:03:19 +02:00
Sebastian Kaspari
4739d292c5 Add Base64 helper class (Written by Robert Harder) - Needed for SASL implementation 2011-06-10 21:42:06 +02:00
Sebastian Kaspari
d9d1c4aba8 (Authentication) Implementation of authentication via NickServ on connect 2011-06-10 21:36:14 +02:00
Sebastian Kaspari
2fde7559e3 (Authentication) GUI for NickServ and SASL 2011-06-10 21:35:23 +02:00
Jonas Häggqvist
d4e22f3846 Ignore status characters in front of nicks for the purpose of nick completion 2011-06-09 20:33:35 +02:00
Sebastian Kaspari
5fa92b9cf4 ConversationClickListener: Remove unused imports 2011-06-08 23:17:59 +02:00
Sebastian Kaspari
14ed6f7f2b IRCService: Code cleanup and suppress warnings 2011-06-08 23:17:31 +02:00
Sebastian Kaspari
2350e9743a DeckAdapter: Remove unused imports 2011-06-08 23:16:49 +02:00
Sebastian Kaspari
1a820d9609 ConversationActivity: Code cleanup, remove unused imports and unused code 2011-06-08 23:16:27 +02:00
Steven Luo
aaf3f3e332 Prevent race between IRCConnection dispose() and onDisconnect() when quitting
When the user asks for a disconnect from the ConversationActivity, there
is a race between the IRCConnection, which is waiting for the server to
acknowledge the QUIT before calling onDisconnect(), and the IRCService,
which will invoke dispose() on the IRCConnection when
checkServiceStatus() is called during the activity shutdown.  If the
dispose() wins, the thread running the onDisconnect() is terminated,
leading to the cleanup being unfinished.  This causes the disconnect
notification to be unreliable, and can result in the list of servers in
the ongoing notification to be out of sync with reality.

To fix this, introduce a new field isQuitting to the IRCConnection,
which is set to true when quitServer() is called and cleared once
onDisconnect() has finished.  If dispose() is called while isQuitting is
set, it sets disposeRequested instead of doing the dispose itself, and
onDisconnect() will call through to super.dispose() once it's finished.

Note that this requires a change to PircBot to allow the overriding of
quitServer(String message), which is declared final upstream.
2011-06-08 23:11:29 +02:00
Steven Luo
a9621b66b4 Bugfix nick completion / autocorrect
Use clearComposingText() when inserting nick completion to ensure
that autocorrect doesn't try to replace the completed nick on the next
keypress; thanks Thomas Martitz for pointing out the bug
2011-06-08 23:11:28 +02:00
Steven Luo
dc95472aaf Fix broadcast on topic change 2011-06-08 23:11:28 +02:00
Steven Luo
06e0849c17 Bugfix notification system
* If there's a new message notification, keep showing the "New messages
   in" content text, even after a disconnect notification.
 * Handle the case of a channel/query name duplicated between two or more
   connections more gracefully in new message notifications
 * Fix a race in updating notifications
2011-06-08 23:11:28 +02:00
Steven Luo
35609e5529 IME behavior changes for the ConversationActivity
(1) Let full-screen IMEs wrap the text into multiple lines instead of
making the text scroll off the screen.

(2) Provide a preference to let the user choose whether or not to enable
autocorrection of typed text.

(3) Provide a preference to let the user choose whether or not to enable
autocapitalization of sentences.  Note that even when this is enabled,
autocapitalization will only happen if the option is also enabled in the
IME.

(4) In landscape mode only, don't replace the Enter key with a Send
button, to make it harder to accidentally send a message.  (We can't do
this in portrait, because we would be left without any send button at
all -- perhaps the input line should be changed to be similar to the
text message application, which has a send button next to the input
line?)
2011-06-08 23:11:28 +02:00
Steven Luo
aa355c4283 Rewrite onKey handling for the ConversationActivity input line
The current method of supplying an onKey handler for the input line
(having the activity implement OnKeyListener) is somewhat unusual -- the
documentation recommends creating an anonymous inner class to pass to
setOnKeyListener().  Do this, while refactoring the code to make it
somewhat more readable and removing some instances of code duplication.
2011-06-08 23:11:28 +02:00
Steven Luo
91d211c51d Make the conversation history size a configurable preference 2011-06-08 23:11:28 +02:00
Steven Luo
61960c9add Overhaul notifications system
Features:
* Now displays the number of mentions that the user has not seen in the
  notification.
* When no mentions are outstanding, display which servers the user is
  connected to, not the last message.
* When more than one mention is outstanding, display the names of the
  conversations with new mentions, not just the last message received.
* Notifications of mentions are suppressed if you're in the conversation
  at the time of the mention.
* Notifications of mentions automatically clear when you bring up the
  conversation.
* Vibrate notifications now generate the user's chosen default vibrate
  pattern, not a hard-coded one.
* Add ticker text to the notification that's displayed when the IRCService
  goes into the foreground, instead of displaying a blank ticker.

To allow for all of this, the implementation moves most of the details
of generating the notification text into the IRCService, which now
exposes addNewMention() and notifyConnected()/notifyDisconnected()
methods instead of the lower-level updateNotification().
2011-06-08 23:11:28 +02:00