Commit Graph

52 Commits

Author SHA1 Message Date
Sebastian Kaspari 21032950b7 Update copright line (2009-2012). 2012-01-21 23:12:55 +01:00
Sebastian Kaspari fbdebc2ca5 Add ActionBarSherlock to all activities. Restructure menu items. Fixes #96. 2012-01-21 23:07:44 +01:00
Sebastian Kaspari 46a45523a8 IRCService: Use reflection to call setForeground() on old versions. 2012-01-21 12:59:02 +01: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 a357c42477 IRCService: suppress rawtype warning 2011-07-17 14:40: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
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
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 d9d1c4aba8 (Authentication) Implementation of authentication via NickServ on connect 2011-06-10 21:36:14 +02:00
Sebastian Kaspari 14ed6f7f2b IRCService: Code cleanup and suppress warnings 2011-06-08 23:17:31 +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 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 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
Steven Luo 09fedc6975 Include channel topic in the displayed conversation title 2011-06-08 23:11:28 +02:00
Steven Luo 9a8bf44d63 Do something sane for private messages where the sender is our nick
As of now, private messages where the sender is our nick end up in
a query window targeted at us.  Show these messages in the query window
of the target instead, which is probably what we want.

This is useful for use with irssi proxy, which will send messages sent
by another client attached to the proxy to us in this way.

(Note that this patch makes a change to PircBot to pass the target of a
private message to the onPrivateMessage handler.)
2011-06-08 23:11:28 +02:00
Steven Luo c9ed28767d Actually deliver actions to existing private message windows 2011-06-08 23:11:28 +02:00
Steven Luo ae1b574997 Dispose of IRCConnections properly to avoid leaking IRCService objects
Each IRCConnection starts an input thread and an output thread when
created; if not stopped, these threads continue to hold the IRCService,
resulting in a leak when the service is stopped.  Fix this by using
PircBot's dispose() to stop the threads when disposing of the
IRCConnection.
2011-06-08 23:11:28 +02:00
Steven Luo c4504be725 Notify the user on receipt of all private messages, not just ones with nick mentions
You'd rarely use someone's nick in a privmsg with them, and this matches
the behavior of other clients.
2011-06-08 23:11:28 +02:00
Steven Luo 464430ee74 Add FLAG_ACTIVITY_NEW_TASK to notification intents
According to
http://developer.android.com/reference/android/app/Notification.html#contentIntent
we should do this.  Suppresses a log message when tapping on our status
bar notification.
2011-06-08 23:11:27 +02:00
Steven Luo caf3272f71 Ensure privmsg with mention of user's nick opens new query when appropriate
If a private message that should open a new query window contains a
mention of the user's nick, the expected new window fails to open
because the isMentioned() path tries to use
server.getConversation().setStatus(), and server.getConversation() is
null in this case.  Fix this by moving the attempt to highlight the
window to a point where a conversation is guaranteed to exist.
2011-06-08 23:11:27 +02:00
Sebastian Kaspari 50a6047edd On own nick change: Display message in server info window (Your are now known as ...). Fixes #51. 2011-04-15 20:30:46 +02:00
Sebastian Kaspari dd07bd358a Bugfix: Only automatically change nickname on server code 433 if not already registered with server 2011-04-12 22:23:51 +02:00
liato 624f8c5014 Add support for mIRC colors. 2011-03-27 19:40:26 +02:00
Sebastian Kaspari 7563437343 Server: Fix typo in addConversation() 2011-03-15 23:59:49 +01:00
Sebastian Kaspari 4262cbcd15 New Setting: Show notices in server window. Closes #47. 2011-03-15 20:53:47 +01:00
Sebastian Kaspari b855b7ea92 Hide join/part setting now hides quit messages too 2011-03-15 20:42:35 +01:00
Sebastian Kaspari 49f067cd67 IRCConnection: Formatting 2011-03-15 20:12:12 +01:00
Sebastian Kaspari 95f3c4b255 Some more simple refactorings 2011-03-14 22:15:13 +01:00
liato a3ebf8d5d0 Handle auto joins after the user has registered with the server. 2011-03-09 08:54:28 +01:00
Thomas Martitz f4637ac582 Use a different color for join/part/quit for the circles in the ConversationSwitcher view.
This makes it easier to ignore unintersting messages wihout turning off the setting to show joins/parts/quits.
Once circle is colored for a new message, the join/part/quit cannot override it anymore.
2011-03-06 11:11:17 +01:00
Sebastian Kaspari 669113610a New user action view and new actions: reply, query 2011-02-05 16:04:36 +01:00
Sebastian Kaspari d8b1a0218f Added 2011 to licence header 2011-02-05 13:00:12 +01:00
Sebastian Kaspari 0fb2338f9c Code cleanup (Formatting) 2011-01-25 21:02:27 +01:00
Sebastian Kaspari feaf1d4aea Fix sound notification 2011-01-15 23:38:56 +01:00
Sebastian Kaspari e014165a17 New setting: Play (notification) sound on highlight 2010-12-17 22:29:33 +01:00
Sebastian Kaspari 4b3e47c799 Set vibration pattern (default does not always work) 2010-12-17 22:19:36 +01:00
Sebastian Kaspari 82e62db96c New setting: Hide join and part messages 2010-11-18 19:25:26 +01:00
Sebastian Kaspari 6c3597ff80 IRCConnection: Just a bracket fix 2010-11-18 18:55:19 +01:00
Sebastian Kaspari 02b7ec1741 Replace all tabs with four spaces! 2010-11-18 18:52:19 +01:00
Sebastian Kaspari f3f195f631 IRCService: Added javadoc 2010-11-18 18:47:12 +01:00
Sebastian Kaspari ce0650d711 IRCService: Fixed a NullPointerException 2010-11-18 18:43:37 +01:00
Sebastian Kaspari 6d2a6bff14 IRCService: imports 2010-11-18 18:33:22 +01:00
liato 3708a9c60c Small modification to the nick matching regular expression. 2010-11-17 02:53:08 +01:00
liato f5b5b99adb Improve detection for nickname in messages. This will prevent notifications from poping up when a word contains the nickname. 2010-11-17 02:36:52 +01:00