Browse files

Hide join/part setting now hides quit messages too

  • Loading branch information...
1 parent 49f067c commit b855b7ea9200819c5450a79a1e9298048639956b @pocmo pocmo committed Mar 15, 2011
View
4 application/res/values-it/strings.xml
@@ -191,6 +191,6 @@
<string name="settings_fontsize_dialog_title">Misura del font</string>
<string name="settings_voice_recognition_title">Riconoscimento vocale</string>
<string name="settings_voice_recognition_desc">Mostra il bottone per il riconoscimento vocale</string>
- <string name="settings_joinpart_title">Mostra entrate ed uscite</string>
- <string name="settings_joinpart_desc">Mostra i messaggi di entrata e di uscita nei canali</string>
+ <string name="settings_joinpartquit_title">Mostra entrate ed uscite</string>
+ <string name="settings_joinpartquit_desc">Mostra i messaggi di entrata e di uscita nei canali</string>
</resources>
View
4 application/res/values/settings.xml
@@ -27,8 +27,8 @@
<string name="key_voice_recognition">voice_recognition</string>
<string name="default_voice_recognition">false</string>
- <string name="key_show_joinpart">show_joinpart</string>
- <string name="default_show_joinpart">true</string>
+ <string name="key_show_joinpartquit">show_joinpartquit</string>
+ <string name="default_show_joinpartquit">true</string>
<string name="key_vibrate_highlight">vibrate_highlight</string>
<string name="default_vibrate_highlight">true</string>
View
4 application/res/values/strings.xml
@@ -192,6 +192,6 @@
<string name="settings_fontsize_dialog_title">Font size</string>
<string name="settings_voice_recognition_title">Voice recognition</string>
<string name="settings_voice_recognition_desc">Show button for voice recognition</string>
- <string name="settings_joinpart_title">Show join and part</string>
- <string name="settings_joinpart_desc">Show join and part messages in channels</string>
+ <string name="settings_joinpartquit_title">Show join, part and quit</string>
+ <string name="settings_joinpartquit_desc">Show join, part and quit messages in channels</string>
</resources>
View
8 application/res/xml/preferences.xml
@@ -66,10 +66,10 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
android:defaultValue="@string/default_24h_format"
android:dependency="@string/key_show_timestamp" />
<CheckBoxPreference
- android:title="@string/settings_joinpart_title"
- android:summary="@string/settings_joinpart_desc"
- android:key="@string/key_show_joinpart"
- android:defaultValue="@string/default_show_joinpart" />
+ android:title="@string/settings_joinpartquit_title"
+ android:summary="@string/settings_joinpartquit_desc"
+ android:key="@string/key_show_joinpartquit"
+ android:defaultValue="@string/default_show_joinpartquit" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/settings_highlight">
View
13 application/src/org/yaaic/irc/IRCConnection.java
@@ -349,7 +349,7 @@ protected void onJoin(String target, String sender, String login, String hostnam
target
);
service.sendBroadcast(intent);
- } else if (service.getSettings().showJoinAndPart()) {
+ } else if (service.getSettings().showJoinPartAndQuit()) {
Message message = new Message(
service.getString(R.string.message_join, sender),
Message.TYPE_MISC
@@ -540,7 +540,7 @@ protected void onPart(String target, String sender, String login, String hostnam
target
);
service.sendBroadcast(intent);
- } else if (service.getSettings().showJoinAndPart()) {
+ } else if (service.getSettings().showJoinPartAndQuit()) {
Message message = new Message(
service.getString(R.string.message_part, sender),
Message.TYPE_MISC
@@ -613,7 +613,11 @@ protected void onPrivateMessage(String sender, String login, String hostname, St
@Override
protected void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason)
{
- if (!sourceNick.equals(this.getNick())) {
+ if (sourceNick.equals(this.getNick())) {
+ return;
+ }
+
+ if (service.getSettings().showJoinPartAndQuit()) {
Vector<String> channels = getChannelsByNickname(sourceNick);
for (String target : channels) {
@@ -654,9 +658,6 @@ protected void onQuit(String sourceNick, String sourceLogin, String sourceHostna
);
service.sendBroadcast(intent);
}
-
- } else {
- // XXX: We quitted
}
}
View
10 application/src/org/yaaic/model/Settings.java
@@ -197,15 +197,15 @@ public boolean isVibrateHighlightEnabled()
}
/**
- * Should join and part messages be displayed?
+ * Should join, part and quit messages be displayed?
*
- * @return True if joins and parts should be displayed, false otherwise
+ * @return True if joins, parts and quits should be displayed, false otherwise
*/
- public boolean showJoinAndPart()
+ public boolean showJoinPartAndQuit()
{
return preferences.getBoolean(
- resources.getString(R.string.key_show_joinpart),
- Boolean.parseBoolean(resources.getString(R.string.default_show_joinpart))
+ resources.getString(R.string.key_show_joinpartquit),
+ Boolean.parseBoolean(resources.getString(R.string.default_show_joinpartquit))
);
}
}

0 comments on commit b855b7e

Please sign in to comment.