├── .gitignore ├── .travis.yml ├── CHANGELOG ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── org │ │ └── yaaic │ │ ├── Yaaic.java │ │ ├── YaaicApplication.java │ │ ├── activity │ │ ├── AboutActivity.java │ │ ├── AddAliasActivity.java │ │ ├── AddChannelActivity.java │ │ ├── AddCommandsActivity.java │ │ ├── AddServerActivity.java │ │ ├── AuthenticationActivity.java │ │ ├── JoinActivity.java │ │ ├── MainActivity.java │ │ ├── MessageActivity.java │ │ ├── UserActivity.java │ │ ├── UsersActivity.java │ │ └── YaaicActivity.java │ │ ├── adapter │ │ ├── ConversationPagerAdapter.java │ │ ├── MessageListAdapter.java │ │ ├── ServersAdapter.java │ │ ├── UserActionListAdapter.java │ │ └── ViewPagerAdapter.java │ │ ├── command │ │ ├── BaseHandler.java │ │ ├── CommandParser.java │ │ └── handler │ │ │ ├── AMsgHandler.java │ │ │ ├── AwayHandler.java │ │ │ ├── BackHandler.java │ │ │ ├── CloseHandler.java │ │ │ ├── DeopHandler.java │ │ │ ├── DevoiceHandler.java │ │ │ ├── EchoHandler.java │ │ │ ├── HelpHandler.java │ │ │ ├── JoinHandler.java │ │ │ ├── KickHandler.java │ │ │ ├── MeHandler.java │ │ │ ├── ModeHandler.java │ │ │ ├── MsgHandler.java │ │ │ ├── NamesHandler.java │ │ │ ├── NickHandler.java │ │ │ ├── NoticeHandler.java │ │ │ ├── OpHandler.java │ │ │ ├── PartHandler.java │ │ │ ├── QueryHandler.java │ │ │ ├── QuitHandler.java │ │ │ ├── RawHandler.java │ │ │ ├── TopicHandler.java │ │ │ ├── VoiceHandler.java │ │ │ └── WhoisHandler.java │ │ ├── db │ │ ├── AliasConstants.java │ │ ├── ChannelConstants.java │ │ ├── CommandConstants.java │ │ ├── Database.java │ │ ├── IdentityConstants.java │ │ └── ServerConstants.java │ │ ├── exception │ │ ├── CommandException.java │ │ └── ValidationException.java │ │ ├── fragment │ │ ├── ConversationFragment.java │ │ ├── OverviewFragment.java │ │ └── SettingsFragment.java │ │ ├── irc │ │ ├── IRCBinder.java │ │ ├── IRCConnection.java │ │ └── IRCService.java │ │ ├── listener │ │ ├── ConversationListener.java │ │ ├── ConversationSelectedListener.java │ │ ├── MessageClickListener.java │ │ └── ServerListener.java │ │ ├── menu │ │ └── ServerPopupMenu.java │ │ ├── model │ │ ├── Authentication.java │ │ ├── Broadcast.java │ │ ├── Channel.java │ │ ├── Conversation.java │ │ ├── Extra.java │ │ ├── Identity.java │ │ ├── Message.java │ │ ├── Query.java │ │ ├── Scrollback.java │ │ ├── Server.java │ │ ├── ServerInfo.java │ │ ├── Settings.java │ │ ├── Status.java │ │ └── User.java │ │ ├── receiver │ │ ├── ConversationReceiver.java │ │ ├── ReconnectReceiver.java │ │ └── ServerReceiver.java │ │ ├── utils │ │ ├── DisplayUtils.java │ │ ├── Emojis.java │ │ └── MircColors.java │ │ └── view │ │ ├── ConversationTabLayout.java │ │ ├── MessageListView.java │ │ ├── ScrimInsetsFrameLayout.java │ │ └── SlidingTabStrip.java │ └── res │ ├── anim │ ├── slide_in_left.xml │ └── slide_out_left.xml │ ├── animator │ └── fab_state_list_animator.xml │ ├── drawable-hdpi │ ├── actionbar_save.png │ ├── actionbar_users.png │ ├── ic_action_discard.png │ ├── ic_action_done.png │ ├── ic_action_menu.png │ ├── ic_action_send.png │ ├── ic_navigation_about.png │ ├── ic_navigation_add.png │ ├── ic_navigation_overview.png │ ├── ic_navigation_server_connected.png │ ├── ic_navigation_server_disconnected.png │ ├── ic_navigation_settings.png │ └── ic_notification.png │ ├── drawable-mdpi │ ├── action.png │ ├── action_ban.png │ ├── action_blank.png │ ├── action_deop.png │ ├── action_devoice.png │ ├── action_kick.png │ ├── action_op.png │ ├── action_query.png │ ├── action_reply.png │ ├── action_voice.png │ ├── actionbar_save.png │ ├── actionbar_users.png │ ├── background.png │ ├── error.png │ ├── ic_action_discard.png │ ├── ic_action_done.png │ ├── ic_action_menu.png │ ├── ic_action_send.png │ ├── ic_navigation_about.png │ ├── ic_navigation_add.png │ ├── ic_navigation_overview.png │ ├── ic_navigation_server_connected.png │ ├── ic_navigation_server_disconnected.png │ ├── ic_navigation_settings.png │ ├── ic_notification.png │ ├── info.png │ ├── join.png │ ├── menu_users.png │ ├── op.png │ ├── part.png │ ├── quit.png │ ├── unknown_image.png │ ├── user.png │ ├── user_title.png │ ├── voice.png │ └── warning.png │ ├── drawable-xhdpi │ ├── actionbar_save.png │ ├── actionbar_users.png │ ├── ic_action_discard.png │ ├── ic_action_done.png │ ├── ic_action_menu.png │ ├── ic_action_send.png │ ├── ic_navigation_about.png │ ├── ic_navigation_add.png │ ├── ic_navigation_overview.png │ ├── ic_navigation_server_connected.png │ ├── ic_navigation_server_disconnected.png │ ├── ic_navigation_settings.png │ └── ic_notification.png │ ├── drawable-xxhdpi │ ├── ic_action_discard.png │ ├── ic_action_done.png │ ├── ic_action_menu.png │ ├── ic_action_send.png │ ├── ic_navigation_about.png │ ├── ic_navigation_add.png │ ├── ic_navigation_overview.png │ ├── ic_navigation_server_connected.png │ ├── ic_navigation_server_disconnected.png │ ├── ic_navigation_settings.png │ └── ic_notification.png │ ├── drawable │ ├── fab_background.xml │ ├── navigation_item_background.xml │ └── plus.xml │ ├── layout │ ├── about.xml │ ├── actionitem.xml │ ├── activity_add_server.xml │ ├── activity_main.xml │ ├── aliasadd.xml │ ├── aliasitem.xml │ ├── authentication.xml │ ├── channeladd.xml │ ├── channeldialog.xml │ ├── channelitem.xml │ ├── commandadd.xml │ ├── commanditem.xml │ ├── fragment_conversations.xml │ ├── fragment_servers.xml │ ├── item_done_discard.xml │ ├── item_drawer.xml │ ├── item_drawer_server.xml │ ├── item_server.xml │ ├── item_toolbar.xml │ ├── join.xml │ ├── message.xml │ ├── servers.xml │ ├── user.xml │ ├── useritem.xml │ └── users.xml │ ├── menu │ ├── context_server.xml │ └── conversations.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values │ ├── animation.xml │ ├── application.xml │ ├── arrays.xml │ ├── attrs.xml │ ├── charsets.xml │ ├── colors.xml │ ├── dimens.xml │ ├── market.xml │ ├── settings.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── preferences.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pircbot ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── yaaic │ └── protocol │ ├── IRCClient.java │ ├── InputThread.java │ ├── IrcException.java │ ├── NickAlreadyInUseException.java │ ├── OutputThread.java │ ├── Queue.java │ ├── User.java │ └── ssl │ └── NaiveTrustManager.java ├── settings.gradle └── web_hi_res_512.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Git Ignore for Yaaic 2 | 3 | # Android Studio & Gradle 4 | *.iml 5 | build/ 6 | .gradle/ 7 | .idea/ 8 | 9 | # MacOS X 10 | .DS_Store 11 | 12 | # Compiled and generated files 13 | bin/ 14 | gen/ 15 | R.java 16 | 17 | # Build files 18 | local.properties 19 | ant.properties 20 | build.xml 21 | proguard.cfg 22 | 23 | # Maven 24 | target/ 25 | 26 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | - platform-tools 5 | - tools 6 | - build-tools-23.0.2 7 | - android-23 8 | - extra-google-google_play_services 9 | - extra-google-m2repository 10 | - extra-android-m2repository 11 | notifications: 12 | irc: "irc.freenode.net#yaaic" 13 | sudo: false 14 | 15 | cache: 16 | directories: 17 | - $HOME/.gradle/caches/ 18 | - $HOME/.gradle/wrapper/ 19 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Thanks to all contributors! 2 | 3 | -------------------------------------------------------------------------------- 4 | Development 5 | -------------------------------------------------------------------------------- 6 | Sebastian Kaspari https://github.com/pocmo 7 | Karol Gliniecki https://github.com/kell 8 | Michael Imamura https://github.com/ZoogieZork 9 | Liato https://github.com/liato 10 | Chantra https://github.com/chantra 11 | Torben Nielsen https://github.com/tkn 12 | Brion Vibber https://github.com/brion 13 | Thomas Martitz https://github.com/kugel- 14 | Mateusz Loskot https://github.com/mloskot 15 | Steven Luo 16 | Jonas Häggqvist https://github.com/rasher 17 | Reyncor https://github.com/Reyncor 18 | Darren Salt https://github.com/dsalt 19 | Daniel E. Moctezuma https://github.com/democtezuma 20 | 21 | -------------------------------------------------------------------------------- 22 | Graphics 23 | -------------------------------------------------------------------------------- 24 | Guenther Beyer http://www.androidicons.com 25 | Jörn Schreiber http://www.joern-schreiber.de 26 | 27 | -------------------------------------------------------------------------------- 28 | Translations 29 | -------------------------------------------------------------------------------- 30 | English Sebastian Kaspari https://github.com/pocmo 31 | Spanish Diego Kuperman https://github.com/diegok 32 | German Daniel Bonkowski 33 | Italian Gianmarco Laggia 34 | French Remi Rampin https://github.com/remram44 35 | Japanese Nobuhiro Ito https://github.com/iseebi 36 | Daniel E. Moctezuma https://github.com/democtezuma 37 | Chinese Leekie (江珑) 38 | Turkish Hasan Kiran 39 | Danish Jonas Häggqvist https://github.com/rasher 40 | Russian NeKit 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/pocmo/Yaaic.svg?branch=master)](https://travis-ci.org/pocmo/Yaaic) 2 | 3 | Yaaic - Yet Another Android IRC Client 4 | ====================================== 5 | 6 | Yaaic is as the full name already says an Internet Relay Chat (IRC) 7 | client for Android devices. 8 | 9 | This is the source code distribution of Yaaic. If you are looking 10 | for a compiled 'ready to use' version (APK), get the official 11 | build at the Google Play Store: 12 | 13 | * https://play.google.com/store/apps/details?id=org.yaaic 14 | 15 | If you are a developer and want to contribute to Yaaic, checkout 16 | our repository at GitHub: 17 | 18 | * http://github.com/pocmo/Yaaic 19 | 20 | The project is using Gradle to build the application. Importing it 21 | into Android Studio should be enough to get it building. 22 | 23 | Drop me a line for questions regarding Yaaic or use one of the 24 | following resources: 25 | 26 | - IRC: irc.freenode.net #yaaic 27 | - Homepage: http://www.yaaic.org 28 | - Google Group: http://groups.google.com/group/yaaic 29 | - Twitter: http://twitter.com/Yaaic 30 | - Facebook: http://www.facebook.com/pages/Yaaic/359902798214 31 | 32 | Third party libraries & resources 33 | ----------------------------------------------------------------------- 34 | 35 | Yaaic includes the PircBot IRC API written by Paul Mutton available 36 | under the GNU General Public License (GPL). http://www.jibble.org 37 | 38 | The Yaaic icon was designed by http://www.androidicons.com 39 | 40 | Some icons are part of the Silk icon set designed by Mark James 41 | available under the Creative Commons Licence Attribution 3.0 42 | Licence. http://www.famfamfam.com 43 | 44 | Copyright (GPL) 45 | ----------------------------------------------------------------------- 46 | 47 | Copyright 2009-2015 Sebastian Kaspari 48 | 49 | Yaaic is free software: you can redistribute it and/or modify 50 | it under the terms of the GNU General Public License as published by 51 | the Free Software Foundation, either version 3 of the License, or 52 | (at your option) any later version. 53 | 54 | Yaaic is distributed in the hope that it will be useful, 55 | but WITHOUT ANY WARRANTY; without even the implied warranty of 56 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 57 | GNU General Public License for more details. 58 | 59 | You should have received a copy of the GNU General Public License 60 | along with Yaaic. If not, see http://www.gnu.org/licenses/ 61 | 62 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '27.0.3' 6 | 7 | defaultConfig { 8 | applicationId "org.yaaic" 9 | minSdkVersion 21 10 | targetSdkVersion 27 11 | versionCode 16 12 | versionName "2.0b" 13 | } 14 | 15 | lintOptions { 16 | // A warning inside of appcompat prevents us from enabling this option 17 | abortOnError false 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation 'com.android.support:support-v4:27.1.1' 23 | implementation 'com.android.support:cardview-v7:27.1.1' 24 | implementation 'com.android.support:recyclerview-v7:27.1.1' 25 | implementation 'com.android.support:appcompat-v7:27.1.1' 26 | implementation 'com.android.support:preference-v14:27.1.1' 27 | implementation 'com.android.support:design:27.1.1' 28 | 29 | implementation project(':pircbot') 30 | } 31 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/YaaicApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic; 22 | 23 | import android.app.Application; 24 | 25 | /** 26 | * Application implementation for Yaaic. 27 | */ 28 | public class YaaicApplication extends Application { 29 | @Override 30 | public void onCreate() { 31 | super.onCreate(); 32 | 33 | Yaaic.getInstance().loadServers(this); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/AboutActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2015 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import android.app.Activity; 24 | import android.content.Intent; 25 | import android.content.pm.PackageManager; 26 | import android.net.Uri; 27 | import android.os.Bundle; 28 | import android.view.View; 29 | import android.view.Window; 30 | import android.widget.TextView; 31 | 32 | import org.yaaic.R; 33 | 34 | /** 35 | * "About" dialog activity. 36 | */ 37 | public class AboutActivity extends Activity { 38 | @Override 39 | public void onCreate(Bundle savedInstanceState) { 40 | super.onCreate(savedInstanceState); 41 | 42 | requestWindowFeature(Window.FEATURE_NO_TITLE); 43 | 44 | setContentView(R.layout.about); 45 | 46 | initializeVersionView(); 47 | initializeIrcView(); 48 | } 49 | 50 | private void initializeVersionView() { 51 | try { 52 | TextView versionView = (TextView) findViewById(R.id.version); 53 | versionView.setText( 54 | getPackageManager().getPackageInfo(getPackageName(), 0).versionName 55 | ); 56 | } catch (PackageManager.NameNotFoundException e) { 57 | throw new AssertionError("Should not happen: Can't read application info of myself"); 58 | } 59 | } 60 | 61 | private void initializeIrcView() { 62 | TextView ircLinkView = (TextView) findViewById(R.id.about_irclink); 63 | ircLinkView.setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View view) { 66 | Intent intent = new Intent(AboutActivity.this, AddServerActivity.class); 67 | intent.setData(Uri.parse(getString(R.string.app_irc))); 68 | startActivity(intent); 69 | } 70 | }); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/JoinActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import org.yaaic.R; 24 | 25 | import android.app.Activity; 26 | import android.content.Intent; 27 | import android.os.Bundle; 28 | import android.view.View; 29 | import android.view.View.OnClickListener; 30 | import android.widget.Button; 31 | import android.widget.EditText; 32 | 33 | /** 34 | * Small dialog to show an edittext for joining channels 35 | * 36 | * @author Sebastian Kaspari 37 | * 38 | */ 39 | public class JoinActivity extends Activity implements OnClickListener 40 | { 41 | /** 42 | * On create 43 | */ 44 | @Override 45 | public void onCreate(Bundle savedInstanceState) 46 | { 47 | super.onCreate(savedInstanceState); 48 | 49 | setContentView(R.layout.join); 50 | 51 | ((Button) findViewById(R.id.join)).setOnClickListener(this); 52 | 53 | ((EditText) findViewById(R.id.channel)).setSelection(1); 54 | } 55 | 56 | /** 57 | * On click 58 | */ 59 | @Override 60 | public void onClick(View v) 61 | { 62 | Intent intent = new Intent(); 63 | intent.putExtra("channel", ((EditText) findViewById(R.id.channel)).getText().toString()); 64 | setResult(RESULT_OK, intent); 65 | finish(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/MessageActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.model.Extra; 25 | 26 | import android.app.Activity; 27 | import android.os.Bundle; 28 | import android.view.Window; 29 | import android.widget.TextView; 30 | 31 | /** 32 | * Activity for single message view 33 | * 34 | * @author Sebastian Kaspari 35 | */ 36 | public class MessageActivity extends Activity 37 | { 38 | /** 39 | * On create 40 | */ 41 | @Override 42 | public void onCreate(Bundle savedInstanceState) 43 | { 44 | super.onCreate(savedInstanceState); 45 | 46 | requestWindowFeature(Window.FEATURE_NO_TITLE); 47 | setContentView(R.layout.message); 48 | 49 | ((TextView) findViewById(R.id.message)).setText( 50 | getIntent().getExtras().getString(Extra.MESSAGE) 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/UserActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.adapter.UserActionListAdapter; 25 | import org.yaaic.model.Extra; 26 | 27 | import android.app.ListActivity; 28 | import android.content.Intent; 29 | import android.os.Bundle; 30 | import android.view.View; 31 | import android.view.Window; 32 | import android.widget.ListView; 33 | import android.widget.TextView; 34 | 35 | /** 36 | * UserActivity 37 | * 38 | * @author Sebastian Kaspari 39 | */ 40 | public class UserActivity extends ListActivity 41 | { 42 | private String nickname; 43 | 44 | /** 45 | * On create 46 | */ 47 | @Override 48 | protected void onCreate(Bundle savedInstanceState) 49 | { 50 | super.onCreate(savedInstanceState); 51 | requestWindowFeature(Window.FEATURE_NO_TITLE); 52 | 53 | setContentView(R.layout.user); 54 | setListAdapter(new UserActionListAdapter()); 55 | 56 | nickname = getIntent().getStringExtra(Extra.USER); 57 | ((TextView) findViewById(R.id.nickname)).setText(nickname); 58 | } 59 | 60 | /** 61 | * On action selected 62 | */ 63 | @Override 64 | protected void onListItemClick(ListView list, View view, int position, long id) 65 | { 66 | Intent intent = new Intent(); 67 | intent.putExtra(Extra.ACTION, (int) id); 68 | intent.putExtra(Extra.USER, nickname); 69 | setResult(RESULT_OK, intent); 70 | finish(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/UsersActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import java.util.Arrays; 24 | 25 | import org.yaaic.R; 26 | import org.yaaic.model.Extra; 27 | 28 | import android.app.ListActivity; 29 | import android.content.Intent; 30 | import android.os.Bundle; 31 | import android.view.View; 32 | import android.view.Window; 33 | import android.widget.AdapterView; 34 | import android.widget.AdapterView.OnItemClickListener; 35 | import android.widget.ArrayAdapter; 36 | 37 | /** 38 | * User Activity - Shows a list of users in the current channel 39 | * 40 | * @author Sebastian Kaspari 41 | */ 42 | public class UsersActivity extends ListActivity implements OnItemClickListener 43 | { 44 | /** 45 | * On create 46 | */ 47 | @Override 48 | public void onCreate(Bundle savedInstanceState) 49 | { 50 | super.onCreate(savedInstanceState); 51 | requestWindowFeature(Window.FEATURE_NO_TITLE); 52 | 53 | setContentView(R.layout.users); 54 | 55 | final String[] users = getIntent().getExtras().getStringArray(Extra.USERS); 56 | getListView().setOnItemClickListener(this); 57 | 58 | // Add sorted list of users in own thread to avoid blocking UI 59 | // TODO: Move to a background task and show loading indicator while sorting 60 | Arrays.sort(users, String.CASE_INSENSITIVE_ORDER); 61 | getListView().setAdapter(new ArrayAdapter(UsersActivity.this, R.layout.useritem, users)); 62 | } 63 | 64 | /** 65 | * On user selected 66 | */ 67 | @Override 68 | public void onItemClick(AdapterView list, View item, int position, long id) 69 | { 70 | Intent intent = new Intent(); 71 | intent.putExtra(Extra.USER, (String) getListView().getAdapter().getItem(position)); 72 | setResult(RESULT_OK, intent); 73 | finish(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/activity/YaaicActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2015 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.activity; 22 | 23 | import android.support.v7.widget.Toolbar; 24 | 25 | import org.yaaic.irc.IRCBinder; 26 | import org.yaaic.model.Server; 27 | 28 | /** 29 | * Interface for fragments accessing functionality of the main activity. 30 | */ 31 | public interface YaaicActivity { 32 | IRCBinder getBinder(); 33 | 34 | Toolbar getToolbar(); 35 | 36 | void setToolbarTitle(String title); 37 | 38 | void onServerSelected(Server server); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/BaseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command; 22 | 23 | import org.yaaic.exception.CommandException; 24 | import org.yaaic.irc.IRCService; 25 | import org.yaaic.model.Conversation; 26 | import org.yaaic.model.Server; 27 | 28 | import android.content.Context; 29 | 30 | /** 31 | * Base class for commands 32 | * 33 | * @author Sebastian Kaspari 34 | */ 35 | public abstract class BaseHandler 36 | { 37 | /** 38 | * Execute the command 39 | * 40 | * @param params The params given (0 is the command itself) 41 | * @param server The server object 42 | * @param channel The channel object or null if no channel is selected 43 | * @param service The service with all server connections 44 | * @throws CommandException if command couldn't be executed 45 | */ 46 | public abstract void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException; 47 | 48 | /** 49 | * Get the usage description for this command 50 | * 51 | * @return The usage description 52 | */ 53 | public abstract String getUsage(); 54 | 55 | /** 56 | * Get the description for this command 57 | * 58 | * @param context The current context. Needed for getting string resources 59 | * @return 60 | */ 61 | public abstract String getDescription(Context context); 62 | 63 | /** 64 | * Merge params to a string 65 | * 66 | * @params params The params to merge 67 | */ 68 | public static String mergeParams(String[] params) 69 | { 70 | return mergeParams(params, 1); 71 | } 72 | 73 | /** 74 | * Merge params to a string 75 | * 76 | * @param params The params to merge 77 | * @param position Start at given param 78 | */ 79 | public static String mergeParams(String[] params, int position) 80 | { 81 | StringBuffer buffer = new StringBuffer(); 82 | 83 | for (; position < params.length; position++) { 84 | buffer.append(params[position]); 85 | buffer.append(" "); 86 | } 87 | 88 | return buffer.toString().trim(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/AwayHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /away [] 34 | * 35 | * Sets you away 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class AwayHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /away 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | service.getConnection(server.getId()).sendRawLineViaQueue("AWAY " + BaseHandler.mergeParams(params)); 48 | } 49 | 50 | /** 51 | * Get description of /away 52 | */ 53 | @Override 54 | public String getDescription(Context context) 55 | { 56 | return context.getString(R.string.command_desc_away); 57 | } 58 | 59 | /** 60 | * Get usage of /away 61 | */ 62 | @Override 63 | public String getUsage() 64 | { 65 | return "/away []"; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/BackHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /back 34 | * 35 | * Turn off the away status 36 | * 37 | * @author Francesco Lavra 38 | */ 39 | public class BackHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /back 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | service.getConnection(server.getId()).sendRawLineViaQueue("AWAY"); 48 | } 49 | 50 | /** 51 | * Get description of /back 52 | */ 53 | @Override 54 | public String getDescription(Context context) 55 | { 56 | return context.getString(R.string.command_desc_back); 57 | } 58 | 59 | /** 60 | * Get usage of /back 61 | */ 62 | @Override 63 | public String getUsage() 64 | { 65 | return "/back"; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/CloseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Server; 30 | 31 | import android.content.Context; 32 | import android.content.Intent; 33 | 34 | /** 35 | * Command: /close 36 | * 37 | * Closes the current window 38 | * 39 | * @author Sebastian Kaspari 40 | */ 41 | public class CloseHandler extends BaseHandler 42 | { 43 | /** 44 | * Execute /close 45 | */ 46 | @Override 47 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 48 | { 49 | if (conversation.getType() == Conversation.TYPE_SERVER) { 50 | throw new CommandException(service.getString(R.string.close_server_window)); 51 | } 52 | 53 | if (params.length == 1) { 54 | if (conversation.getType() == Conversation.TYPE_CHANNEL) { 55 | service.getConnection(server.getId()).partChannel(conversation.getName()); 56 | } 57 | if (conversation.getType() == Conversation.TYPE_QUERY) { 58 | server.removeConversation(conversation.getName()); 59 | 60 | Intent intent = Broadcast.createConversationIntent( 61 | Broadcast.CONVERSATION_REMOVE, 62 | server.getId(), 63 | conversation.getName() 64 | ); 65 | service.sendBroadcast(intent); 66 | } 67 | } 68 | } 69 | 70 | /** 71 | * Usage of /close 72 | */ 73 | @Override 74 | public String getUsage() 75 | { 76 | return "/close"; 77 | } 78 | 79 | /** 80 | * Description of /close 81 | */ 82 | @Override 83 | public String getDescription(Context context) 84 | { 85 | return context.getString(R.string.command_desc_close); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/DeopHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /deop 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class DeopHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /deop 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 46 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 47 | } 48 | 49 | if (params.length == 2) { 50 | service.getConnection(server.getId()).deOp(conversation.getName(), params[1]); 51 | } else { 52 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 53 | } 54 | } 55 | 56 | /** 57 | * Usage of /deop 58 | */ 59 | @Override 60 | public String getUsage() 61 | { 62 | return "/deop "; 63 | } 64 | 65 | /** 66 | * Description of /deop 67 | */ 68 | @Override 69 | public String getDescription(Context context) 70 | { 71 | return context.getString(R.string.command_desc_deop); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/DevoiceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /devoice 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class DevoiceHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /devoice 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 46 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 47 | } 48 | 49 | if (params.length == 2) { 50 | service.getConnection(server.getId()).deVoice(conversation.getName(), params[1]); 51 | } else { 52 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 53 | } 54 | } 55 | 56 | /** 57 | * Usage of /devoice 58 | */ 59 | @Override 60 | public String getUsage() 61 | { 62 | return "/devoice "; 63 | } 64 | 65 | /** 66 | * Description of /devoice 67 | */ 68 | @Override 69 | public String getDescription(Context context) 70 | { 71 | return context.getString(R.string.command_desc_devoice); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/EchoHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Message; 30 | import org.yaaic.model.Server; 31 | 32 | import android.content.Context; 33 | import android.content.Intent; 34 | 35 | /** 36 | * Command: /echo 37 | * 38 | * @author Sebastian Kaspari 39 | */ 40 | public class EchoHandler extends BaseHandler 41 | { 42 | /** 43 | * Execute /echo 44 | */ 45 | @Override 46 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 47 | { 48 | if (params.length > 1) { 49 | Message message = new Message(BaseHandler.mergeParams(params)); 50 | conversation.addMessage(message); 51 | 52 | Intent intent = Broadcast.createConversationIntent( 53 | Broadcast.CONVERSATION_MESSAGE, 54 | server.getId(), 55 | conversation.getName() 56 | ); 57 | service.sendBroadcast(intent); 58 | } else { 59 | throw new CommandException(service.getString(R.string.text_missing)); 60 | } 61 | } 62 | 63 | /** 64 | * Usage of /echo 65 | */ 66 | @Override 67 | public String getUsage() 68 | { 69 | return "/echo "; 70 | } 71 | 72 | /** 73 | * Description of /echo 74 | */ 75 | @Override 76 | public String getDescription(Context context) 77 | { 78 | return context.getString(R.string.command_desc_echo); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/JoinHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /join [] 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class JoinHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /join 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (params.length == 2) { 46 | service.getConnection(server.getId()).joinChannel(params[1]); 47 | } else if (params.length == 3) { 48 | service.getConnection(server.getId()).joinChannel(params[1], params[2]); 49 | } else { 50 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 51 | } 52 | } 53 | 54 | /** 55 | * Usage of /join 56 | */ 57 | @Override 58 | public String getUsage() 59 | { 60 | return "/join []"; 61 | } 62 | 63 | /** 64 | * Description of /join 65 | */ 66 | @Override 67 | public String getDescription(Context context) 68 | { 69 | return context.getString(R.string.command_desc_join); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/KickHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /kick 34 | * 35 | * Kicks a user from the current channel 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class KickHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /kick 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 48 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 49 | } 50 | 51 | if (params.length == 2) { 52 | service.getConnection(server.getId()).kick(conversation.getName(), params[1]); 53 | } else { 54 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 55 | } 56 | } 57 | 58 | /** 59 | * Usage of /kick 60 | */ 61 | @Override 62 | public String getUsage() 63 | { 64 | return "/kick "; 65 | } 66 | 67 | /** 68 | * Description of /kick 69 | */ 70 | @Override 71 | public String getDescription(Context context) 72 | { 73 | return context.getString(R.string.command_desc_kick); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/MeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Message; 30 | import org.yaaic.model.Server; 31 | 32 | import android.content.Context; 33 | import android.content.Intent; 34 | 35 | /** 36 | * Command: /me 37 | * 38 | * @author Sebastian Kaspari 39 | */ 40 | public class MeHandler extends BaseHandler 41 | { 42 | /** 43 | * Execute /me 44 | */ 45 | @Override 46 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 47 | { 48 | if (conversation.getType() == Conversation.TYPE_SERVER) { 49 | throw new CommandException(service.getString(R.string.only_usable_from_channel_or_query)); 50 | } 51 | 52 | if (params.length > 1) { 53 | String action = BaseHandler.mergeParams(params); 54 | String nickname = service.getConnection(server.getId()).getNick(); 55 | 56 | Message message = new Message(nickname + " " + action); 57 | message.setIcon(R.drawable.action); 58 | server.getConversation(conversation.getName()).addMessage(message); 59 | 60 | Intent intent = Broadcast.createConversationIntent( 61 | Broadcast.CONVERSATION_MESSAGE, 62 | server.getId(), 63 | conversation.getName() 64 | ); 65 | service.sendBroadcast(intent); 66 | 67 | service.getConnection(server.getId()).sendAction(conversation.getName(), action); 68 | } else { 69 | throw new CommandException(service.getString(R.string.text_missing)); 70 | } 71 | } 72 | 73 | /** 74 | * Usage of /me 75 | */ 76 | @Override 77 | public String getUsage() 78 | { 79 | return "/me "; 80 | } 81 | 82 | /** 83 | * Description of /me 84 | */ 85 | @Override 86 | public String getDescription(Context context) 87 | { 88 | return context.getString(R.string.command_desc_me); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/ModeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /mode 34 | * 35 | * Set or remove channel modes 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class ModeHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /mode 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | if (params.length > 2) { 48 | String modes = BaseHandler.mergeParams(params, 2); 49 | 50 | service.getConnection(server.getId()).setMode(params[1], modes); 51 | } else { 52 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 53 | } 54 | } 55 | 56 | /** 57 | * Usage of /mode 58 | */ 59 | @Override 60 | public String getUsage() 61 | { 62 | return "/mode "; 63 | } 64 | 65 | /** 66 | * Description of /mode 67 | */ 68 | @Override 69 | public String getDescription(Context context) 70 | { 71 | return context.getString(R.string.command_desc_mode); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/MsgHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Message; 30 | import org.yaaic.model.Server; 31 | 32 | import android.content.Context; 33 | import android.content.Intent; 34 | 35 | /** 36 | * Command: /msg 37 | * 38 | * Send a message to a channel or user 39 | * 40 | * @author Sebastian Kaspari 41 | */ 42 | public class MsgHandler extends BaseHandler 43 | { 44 | /** 45 | * Execute /msg 46 | */ 47 | @Override 48 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 49 | { 50 | if (params.length > 2) { 51 | String text = BaseHandler.mergeParams(params, 2); 52 | service.getConnection(server.getId()).sendMessage(params[1], text); 53 | 54 | Conversation targetConversation = server.getConversation(params[1]); 55 | 56 | if (targetConversation != null) { 57 | Message message = new Message("<" + service.getConnection(server.getId()).getNick() + "> " + text); 58 | targetConversation.addMessage(message); 59 | 60 | Intent intent = Broadcast.createConversationIntent( 61 | Broadcast.CONVERSATION_MESSAGE, 62 | server.getId(), 63 | targetConversation.getName() 64 | ); 65 | 66 | service.sendBroadcast(intent); 67 | } 68 | } else { 69 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 70 | } 71 | } 72 | 73 | /** 74 | * Usage of /msg 75 | */ 76 | @Override 77 | public String getUsage() 78 | { 79 | return "/msg "; 80 | } 81 | 82 | /** 83 | * Description of /msg 84 | */ 85 | @Override 86 | public String getDescription(Context context) 87 | { 88 | return context.getString(R.string.command_desc_msg); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/NamesHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.protocol.User; 24 | import org.yaaic.R; 25 | import org.yaaic.command.BaseHandler; 26 | import org.yaaic.exception.CommandException; 27 | import org.yaaic.irc.IRCService; 28 | import org.yaaic.model.Broadcast; 29 | import org.yaaic.model.Conversation; 30 | import org.yaaic.model.Message; 31 | import org.yaaic.model.Server; 32 | 33 | import android.content.Context; 34 | import android.content.Intent; 35 | 36 | /** 37 | * Command: /names 38 | * Lists all users currently in the selected channel 39 | * 40 | * @author Sebastian Kaspari 41 | */ 42 | public class NamesHandler extends BaseHandler 43 | { 44 | /** 45 | * Execute /names 46 | */ 47 | @Override 48 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 49 | { 50 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 51 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 52 | } 53 | 54 | StringBuffer userList = new StringBuffer(service.getString(R.string.message_users_on_chan, conversation.getName())); 55 | 56 | User[] mUsers = service.getConnection(server.getId()).getUsers(conversation.getName()); 57 | int mSize = mUsers.length; 58 | for (int i = 0; i < mSize; i++) { 59 | userList.append(" "); 60 | userList.append(mUsers[i].getPrefix()); 61 | userList.append(mUsers[i].getNick()); 62 | } 63 | 64 | Message message = new Message(userList.toString()); 65 | message.setColor(Message.COLOR_YELLOW); 66 | conversation.addMessage(message); 67 | 68 | Intent intent = Broadcast.createConversationIntent( 69 | Broadcast.CONVERSATION_MESSAGE, 70 | server.getId(), 71 | conversation.getName() 72 | ); 73 | service.sendBroadcast(intent); 74 | } 75 | 76 | /** 77 | * Usage of /names 78 | */ 79 | @Override 80 | public String getUsage() 81 | { 82 | return "/names"; 83 | } 84 | 85 | /** 86 | * Description of /names 87 | */ 88 | @Override 89 | public String getDescription(Context context) 90 | { 91 | return context.getString(R.string.command_desc_names); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/NickHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /nick 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class NickHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /nick 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (params.length == 2) { 46 | service.getConnection(server.getId()).changeNick(params[1]); 47 | } else { 48 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 49 | } 50 | } 51 | 52 | /** 53 | * Usage of /nick 54 | */ 55 | @Override 56 | public String getUsage() 57 | { 58 | return "/nick "; 59 | } 60 | 61 | /** 62 | * Description of /nick 63 | */ 64 | @Override 65 | public String getDescription(Context context) 66 | { 67 | return context.getString(R.string.command_desc_nick); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/NoticeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Message; 30 | import org.yaaic.model.Server; 31 | 32 | import android.content.Context; 33 | import android.content.Intent; 34 | 35 | /** 36 | * Command: /notice 37 | * 38 | * Send a notice to an other user 39 | * 40 | * @author Sebastian Kaspari 41 | */ 42 | public class NoticeHandler extends BaseHandler 43 | { 44 | /** 45 | * Execute /notice 46 | */ 47 | @Override 48 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 49 | { 50 | if (params.length > 2) { 51 | String text = BaseHandler.mergeParams(params); 52 | 53 | Message message = new Message(">" + params[1] + "< " + text); 54 | message.setIcon(R.drawable.info); 55 | conversation.addMessage(message); 56 | 57 | Intent intent = Broadcast.createConversationIntent( 58 | Broadcast.CONVERSATION_MESSAGE, 59 | server.getId(), 60 | conversation.getName() 61 | ); 62 | service.sendBroadcast(intent); 63 | 64 | service.getConnection(server.getId()).sendNotice(params[1], text); 65 | } else { 66 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 67 | } 68 | } 69 | 70 | /** 71 | * Usage of /notice 72 | */ 73 | @Override 74 | public String getUsage() 75 | { 76 | return "/notice "; 77 | } 78 | 79 | /** 80 | * Description of /notice 81 | */ 82 | @Override 83 | public String getDescription(Context context) 84 | { 85 | return context.getString(R.string.command_desc_notice); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/OpHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /deop 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class OpHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /deop 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 46 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 47 | } 48 | 49 | if (params.length == 2) { 50 | service.getConnection(server.getId()).op(conversation.getName(), params[1]); 51 | } else { 52 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 53 | } 54 | } 55 | 56 | /** 57 | * Usage of /deop 58 | */ 59 | @Override 60 | public String getUsage() 61 | { 62 | return "/op "; 63 | } 64 | 65 | /** 66 | * Description of /deop 67 | */ 68 | @Override 69 | public String getDescription(Context context) 70 | { 71 | return context.getString(R.string.command_desc_op); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/PartHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /part [] 34 | * 35 | * Leave the current or the given channel 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class PartHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /part 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | if (params.length == 1) { 48 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 49 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 50 | } 51 | 52 | service.getConnection(server.getId()).partChannel(conversation.getName()); 53 | } else if (params.length == 2) { 54 | service.getConnection(server.getId()).partChannel(params[1]); 55 | } else { 56 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 57 | } 58 | } 59 | 60 | /** 61 | * Usage of /part 62 | */ 63 | @Override 64 | public String getUsage() 65 | { 66 | return "/part []"; 67 | } 68 | 69 | /** 70 | * Description of /part 71 | */ 72 | @Override 73 | public String getDescription(Context context) 74 | { 75 | return context.getString(R.string.command_desc_part); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/QueryHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Broadcast; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Query; 30 | import org.yaaic.model.Server; 31 | 32 | import android.content.Context; 33 | import android.content.Intent; 34 | 35 | /** 36 | * Command: /query 37 | * 38 | * Opens a private chat with the given user 39 | * 40 | * @author Sebastian Kaspari 41 | */ 42 | public class QueryHandler extends BaseHandler 43 | { 44 | /** 45 | * Execute /query 46 | */ 47 | @Override 48 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 49 | { 50 | if (params.length == 2) { 51 | // Simple validation 52 | if (params[1].startsWith("#")) { 53 | throw new CommandException(service.getString(R.string.query_to_channel)); 54 | } 55 | 56 | Conversation query = server.getConversation(params[1]); 57 | 58 | if (query != null) { 59 | throw new CommandException(service.getString(R.string.query_exists)); 60 | } 61 | 62 | query = new Query(params[1]); 63 | query.setHistorySize(service.getSettings().getHistorySize()); 64 | server.addConversation(query); 65 | 66 | Intent intent = Broadcast.createConversationIntent( 67 | Broadcast.CONVERSATION_NEW, 68 | server.getId(), 69 | query.getName() 70 | ); 71 | service.sendBroadcast(intent); 72 | } else { 73 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 74 | } 75 | } 76 | 77 | /** 78 | * Usage of /query 79 | */ 80 | @Override 81 | public String getUsage() 82 | { 83 | return "/query "; 84 | } 85 | 86 | /** 87 | * Description of /query 88 | */ 89 | @Override 90 | public String getDescription(Context context) 91 | { 92 | return context.getString(R.string.command_desc_query); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/QuitHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /quit [] 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class QuitHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /quit 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (params.length == 1) { 46 | service.getConnection(server.getId()).quitServer(); 47 | } else { 48 | service.getConnection(server.getId()).quitServer(BaseHandler.mergeParams(params)); 49 | } 50 | } 51 | 52 | /** 53 | * Usage of /quit 54 | */ 55 | @Override 56 | public String getUsage() 57 | { 58 | return "/quit []"; 59 | } 60 | 61 | /** 62 | * Description of /quit 63 | */ 64 | @Override 65 | public String getDescription(Context context) 66 | { 67 | return context.getString(R.string.command_desc_quit); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/RawHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /raw 34 | * 35 | * Send a raw line to the server 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class RawHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /raw 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | if (params.length > 1) { 48 | String line = BaseHandler.mergeParams(params); 49 | service.getConnection(server.getId()).sendRawLineViaQueue(line); 50 | } else { 51 | throw new CommandException(service.getString(R.string.line_missing)); 52 | } 53 | } 54 | 55 | /** 56 | * Usage of /raw 57 | */ 58 | @Override 59 | public String getUsage() 60 | { 61 | return "/raw "; 62 | } 63 | 64 | /** 65 | * Description of /raw 66 | */ 67 | @Override 68 | public String getDescription(Context context) 69 | { 70 | return context.getString(R.string.command_desc_raw); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/TopicHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Channel; 28 | import org.yaaic.model.Conversation; 29 | import org.yaaic.model.Server; 30 | 31 | import android.content.Context; 32 | 33 | /** 34 | * Command: /topic [] 35 | * 36 | * Show the current topic or change the topic if a new topic is provided 37 | * 38 | * @author Sebastian Kaspari 39 | */ 40 | public class TopicHandler extends BaseHandler 41 | { 42 | /** 43 | * Execute /topic 44 | */ 45 | @Override 46 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 47 | { 48 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 49 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 50 | } 51 | 52 | Channel channel = (Channel) conversation; 53 | 54 | if (params.length == 1) { 55 | // Show topic 56 | service.getConnection(server.getId()).onTopic(channel.getName(), channel.getTopic(), "", 0, false); 57 | } else if (params.length > 1) { 58 | // Change topic 59 | service.getConnection(server.getId()).setTopic(channel.getName(), BaseHandler.mergeParams(params)); 60 | } 61 | } 62 | 63 | /** 64 | * Usage of /topic 65 | */ 66 | @Override 67 | public String getUsage() 68 | { 69 | return "/topic []"; 70 | } 71 | 72 | /** 73 | * Description of /topic 74 | */ 75 | @Override 76 | public String getDescription(Context context) 77 | { 78 | return context.getString(R.string.command_desc_topic); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/VoiceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /voice 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class VoiceHandler extends BaseHandler 38 | { 39 | /** 40 | * Execute /voice 41 | */ 42 | @Override 43 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 44 | { 45 | if (conversation.getType() != Conversation.TYPE_CHANNEL) { 46 | throw new CommandException(service.getString(R.string.only_usable_from_channel)); 47 | } 48 | 49 | if (params.length == 2) { 50 | service.getConnection(server.getId()).voice(conversation.getName(), params[1]); 51 | } else { 52 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 53 | } 54 | } 55 | 56 | /** 57 | * Usage of /voice 58 | */ 59 | @Override 60 | public String getUsage() 61 | { 62 | return "/voice "; 63 | } 64 | 65 | /** 66 | * Description of /voice 67 | */ 68 | @Override 69 | public String getDescription(Context context) 70 | { 71 | return context.getString(R.string.command_desc_voice); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/command/handler/WhoisHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.command.handler; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.command.BaseHandler; 25 | import org.yaaic.exception.CommandException; 26 | import org.yaaic.irc.IRCService; 27 | import org.yaaic.model.Conversation; 28 | import org.yaaic.model.Server; 29 | 30 | import android.content.Context; 31 | 32 | /** 33 | * Command: /whois 34 | * 35 | * Get information about a user 36 | * 37 | * @author Sebastian Kaspari 38 | */ 39 | public class WhoisHandler extends BaseHandler 40 | { 41 | /** 42 | * Execute /whois 43 | */ 44 | @Override 45 | public void execute(String[] params, Server server, Conversation conversation, IRCService service) throws CommandException 46 | { 47 | if (params.length != 2) { 48 | throw new CommandException(service.getString(R.string.invalid_number_of_params)); 49 | } 50 | 51 | service.getConnection(server.getId()).sendRawLineViaQueue("WHOIS " + params[1]); 52 | } 53 | 54 | /** 55 | * Get description of /whois 56 | */ 57 | @Override 58 | public String getDescription(Context context) 59 | { 60 | return context.getString(R.string.command_desc_whois); 61 | } 62 | 63 | /** 64 | * Get usage of /whois 65 | */ 66 | @Override 67 | public String getUsage() 68 | { 69 | return "/whois "; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/db/AliasConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.db; 22 | 23 | import android.provider.BaseColumns; 24 | 25 | /** 26 | * Constants for the aliases table 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public class AliasConstants implements BaseColumns 31 | { 32 | public static final String TABLE_NAME = "aliases"; 33 | 34 | // fields 35 | public static final String ALIAS = "alias"; 36 | public static final String IDENTITY = "identity"; 37 | 38 | /** 39 | * All fields of the table 40 | */ 41 | public static final String[] ALL = { 42 | _ID, 43 | ALIAS, 44 | IDENTITY, 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/db/ChannelConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.db; 22 | 23 | import android.provider.BaseColumns; 24 | 25 | /** 26 | * Constants for the channel table 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public interface ChannelConstants extends BaseColumns 31 | { 32 | public static final String TABLE_NAME = "channels"; 33 | 34 | // fields 35 | public static final String NAME = "name"; 36 | public static final String PASSWORD = "password"; 37 | public static final String SERVER = "server"; 38 | 39 | /** 40 | * All fields of the table 41 | */ 42 | public static final String[] ALL = { 43 | NAME, 44 | PASSWORD, 45 | SERVER 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/db/CommandConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.db; 22 | 23 | import android.provider.BaseColumns; 24 | 25 | /** 26 | * Constants for the command table 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public interface CommandConstants extends BaseColumns 31 | { 32 | public static final String TABLE_NAME = "commands"; 33 | 34 | // fields 35 | public static final String COMMAND = "command"; 36 | public static final String SERVER = "server"; 37 | 38 | /** 39 | * All fields of the table 40 | */ 41 | public static final String[] ALL = { 42 | COMMAND, 43 | SERVER 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/db/IdentityConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.db; 22 | 23 | import android.provider.BaseColumns; 24 | 25 | /** 26 | * Constants for the identity table 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public class IdentityConstants implements BaseColumns 31 | { 32 | public static final String TABLE_NAME = "identities"; 33 | 34 | // fields 35 | public static final String NICKNAME = "nickname"; 36 | public static final String IDENT = "ident"; 37 | public static final String REALNAME = "realname"; 38 | 39 | /** 40 | * All fields of the table 41 | */ 42 | public static final String[] ALL = { 43 | _ID, 44 | NICKNAME, 45 | IDENT, 46 | REALNAME, 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/db/ServerConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.db; 22 | 23 | import android.provider.BaseColumns; 24 | 25 | /** 26 | * Constants for the server table 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public interface ServerConstants extends BaseColumns 31 | { 32 | public static final String TABLE_NAME = "servers"; 33 | 34 | // fields 35 | public static final String TITLE = "title"; 36 | public static final String HOST = "host"; 37 | public static final String PORT = "port"; 38 | public static final String PASSWORD = "password"; 39 | public static final String AUTOCONNECT = "autoConnect"; 40 | public static final String USE_SSL = "useSSL"; 41 | public static final String CHARSET = "charset"; 42 | public static final String IDENTITY = "identity"; 43 | public static final String NICKSERV_PASSWORD = "nickserv_password"; 44 | public static final String SASL_USERNAME = "sasl_username"; 45 | public static final String SASL_PASSWORD = "sasl_password"; 46 | 47 | /** 48 | * All fields of the table 49 | */ 50 | public static final String[] ALL = { 51 | _ID, 52 | TITLE, 53 | HOST, 54 | PORT, 55 | PASSWORD, 56 | AUTOCONNECT, 57 | USE_SSL, 58 | CHARSET, 59 | IDENTITY, 60 | NICKSERV_PASSWORD, 61 | SASL_USERNAME, 62 | SASL_PASSWORD 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/exception/CommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.exception; 22 | 23 | /** 24 | * The CommandException is thrown on command execution if the 25 | * command couldn't be executed due to invalid params 26 | * 27 | * @author Sebastian Kaspari 28 | */ 29 | public class CommandException extends Throwable 30 | { 31 | private static final long serialVersionUID = -8317993941455253288L; 32 | 33 | /** 34 | * Create a new CommandException object 35 | */ 36 | public CommandException(String message) 37 | { 38 | super(message); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/exception/ValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.exception; 22 | 23 | /** 24 | * A ValidationException is thrown if any user input is invalid 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class ValidationException extends Exception 29 | { 30 | private static final long serialVersionUID = 6951535205062761539L; 31 | 32 | /** 33 | * Create a new ValidationException with the given message 34 | * 35 | * @param message The error message 36 | */ 37 | public ValidationException(String message) 38 | { 39 | super(message); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/fragment/SettingsFragment.java: -------------------------------------------------------------------------------- 1 | package org.yaaic.fragment; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.preference.Preference; 6 | import android.support.v7.preference.PreferenceFragmentCompat; 7 | 8 | import org.yaaic.R; 9 | import org.yaaic.activity.YaaicActivity; 10 | 11 | /** 12 | * Fragment displaying all settings. 13 | */ 14 | public class SettingsFragment extends PreferenceFragmentCompat { 15 | public static final String TRANSACTION_TAG = "fragment_settings"; 16 | 17 | private YaaicActivity activity; 18 | 19 | @Override 20 | public void onAttach(Context context) { 21 | super.onAttach(context); 22 | 23 | if (!(context instanceof YaaicActivity)) { 24 | throw new IllegalArgumentException("Activity has to implement YaaicActivity interface"); 25 | } 26 | 27 | this.activity = (YaaicActivity) context; 28 | } 29 | 30 | @Override 31 | public void onCreatePreferences(Bundle bundle, String s) { 32 | addPreferencesFromResource(R.xml.preferences); 33 | } 34 | 35 | @Override 36 | public void onResume() { 37 | super.onResume(); 38 | 39 | activity.setToolbarTitle(getString(R.string.navigation_settings)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/irc/IRCBinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.irc; 22 | 23 | import org.yaaic.model.Server; 24 | 25 | import android.os.Binder; 26 | 27 | /** 28 | * Binder for service communication 29 | * 30 | * @author Sebastian Kaspari 31 | */ 32 | public class IRCBinder extends Binder 33 | { 34 | private final IRCService service; 35 | 36 | /** 37 | * Create a new binder for given service 38 | * 39 | * @param service 40 | */ 41 | public IRCBinder(IRCService service) 42 | { 43 | super(); 44 | 45 | this.service = service; 46 | } 47 | 48 | /** 49 | * Connect to given server 50 | * 51 | * @param server 52 | */ 53 | public void connect(final Server server) 54 | { 55 | service.connect(server); 56 | } 57 | 58 | /** 59 | * Get service associated with this binder 60 | * 61 | * @return 62 | */ 63 | public IRCService getService() 64 | { 65 | return service; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/listener/ConversationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.listener; 22 | 23 | /** 24 | * Listener for conversations 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public interface ConversationListener 29 | { 30 | /** 31 | * On new conversation message for given target 32 | * 33 | * @param target 34 | */ 35 | public void onConversationMessage(String target); 36 | 37 | /** 38 | * On new conversation created (for given target) 39 | * 40 | * @param target 41 | */ 42 | public void onNewConversation(String target); 43 | 44 | /** 45 | * On conversation removed (for given target) 46 | * 47 | * @param target 48 | */ 49 | public void onRemoveConversation(String target); 50 | 51 | /** 52 | * On topic changed (for given target) 53 | * 54 | * @param target 55 | */ 56 | public void onTopicChanged(String target); 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/listener/MessageClickListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.listener; 22 | 23 | import org.yaaic.activity.MessageActivity; 24 | import org.yaaic.adapter.MessageListAdapter; 25 | import org.yaaic.model.Extra; 26 | 27 | import android.content.Intent; 28 | import android.view.View; 29 | import android.widget.AdapterView; 30 | import android.widget.AdapterView.OnItemClickListener; 31 | 32 | /** 33 | * Listener for clicks on conversation messages 34 | * 35 | * @author Sebastian Kaspari 36 | */ 37 | public class MessageClickListener implements OnItemClickListener 38 | { 39 | private static MessageClickListener instance; 40 | 41 | /** 42 | * Private constructor 43 | */ 44 | private MessageClickListener() 45 | { 46 | } 47 | 48 | /** 49 | * Get global instance of message click listener 50 | * 51 | * @return 52 | */ 53 | public static synchronized MessageClickListener getInstance() 54 | { 55 | if (instance == null) { 56 | instance = new MessageClickListener(); 57 | } 58 | 59 | return instance; 60 | } 61 | 62 | /** 63 | * On message item clicked 64 | */ 65 | @Override 66 | public void onItemClick(AdapterView group, View view, int position, long id) 67 | { 68 | MessageListAdapter adapter = (MessageListAdapter) group.getAdapter(); 69 | 70 | Intent intent = new Intent(group.getContext(), MessageActivity.class); 71 | intent.putExtra(Extra.MESSAGE, adapter.getItem(position).getText().toString()); 72 | group.getContext().startActivity(intent); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/listener/ServerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.listener; 22 | 23 | /** 24 | * Listener for changes regarding a server 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public interface ServerListener 29 | { 30 | /** 31 | * On server status update (disconnected, connecting, connected) 32 | */ 33 | public void onStatusUpdate(); 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/menu/ServerPopupMenu.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.menu; 22 | 23 | import android.content.Context; 24 | import android.view.MenuItem; 25 | import android.view.View; 26 | import android.widget.PopupMenu; 27 | 28 | import org.yaaic.R; 29 | import org.yaaic.adapter.ServersAdapter; 30 | import org.yaaic.model.Server; 31 | 32 | /** 33 | * Popup menu for the server cards. 34 | */ 35 | public class ServerPopupMenu extends PopupMenu implements PopupMenu.OnMenuItemClickListener, View.OnClickListener { 36 | private Server server; 37 | private ServersAdapter.ClickListener listener; 38 | 39 | public ServerPopupMenu(Context context, View anchor, ServersAdapter.ClickListener listener) { 40 | super(context, anchor); 41 | 42 | this.listener = listener; 43 | 44 | getMenuInflater().inflate(R.menu.context_server, getMenu()); 45 | setOnMenuItemClickListener(this); 46 | 47 | anchor.setOnClickListener(this); 48 | } 49 | 50 | public void updateServer(Server server) { 51 | this.server = server; 52 | } 53 | 54 | @Override 55 | public boolean onMenuItemClick(MenuItem item) { 56 | int id = item.getItemId(); 57 | 58 | switch (id) { 59 | case R.id.edit: 60 | listener.onEditServer(server); 61 | break; 62 | case R.id.delete: 63 | listener.onDeleteServer(server); 64 | break; 65 | case R.id.connect: 66 | listener.onConnectToServer(server); 67 | break; 68 | case R.id.disconnect: 69 | listener.onDisconnectFromServer(server); 70 | break; 71 | } 72 | 73 | return true; 74 | } 75 | 76 | public void onClick(View v) { 77 | show(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Broadcast.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | import android.content.Intent; 24 | 25 | /** 26 | * Constants and helpers for Broadcasts 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public abstract class Broadcast 31 | { 32 | public static final String SERVER_UPDATE = "org.yaaic.server.status"; 33 | public static final String SERVER_RECONNECT = "org.yaaic.server.reconnect."; 34 | 35 | public static final String CONVERSATION_MESSAGE = "org.yaaic.conversation.message"; 36 | public static final String CONVERSATION_NEW = "org.yaaic.conversation.new"; 37 | public static final String CONVERSATION_REMOVE = "org.yaaic.conversation.remove"; 38 | public static final String CONVERSATION_TOPIC = "org.yaaic.conversation.topic"; 39 | 40 | /** 41 | * Create an Intent for conversation broadcasting 42 | * 43 | * @param broadcastType The type of the broadcast, some constant of Broadcast.* 44 | * @param serverId The id of the server 45 | * @param conversationName The unique name of the conversation 46 | * @return The created Intent 47 | */ 48 | public static Intent createConversationIntent(String broadcastType, int serverId, String conversationName) 49 | { 50 | Intent intent = new Intent(broadcastType); 51 | 52 | intent.putExtra(Extra.SERVER, serverId); 53 | intent.putExtra(Extra.CONVERSATION, conversationName); 54 | 55 | return intent; 56 | } 57 | 58 | /** 59 | * Create an Intent for server broadcasting 60 | * 61 | * @param broadcastType The typo of the broadcast, some constant of Broadcast.* 62 | * @param serverId The id of the server 63 | * @return The created Intent 64 | */ 65 | public static Intent createServerIntent(String broadcastType, int serverId) 66 | { 67 | Intent intent = new Intent(broadcastType); 68 | 69 | intent.putExtra(Extra.SERVER, serverId); 70 | 71 | return intent; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Channel.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * An IRC channel (extends Conversation) 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class Channel extends Conversation 29 | { 30 | private String topic; 31 | 32 | /** 33 | * Create a new channel object 34 | * 35 | * @param name of the channel 36 | */ 37 | public Channel(String name) 38 | { 39 | super(name); 40 | this.topic = ""; 41 | } 42 | 43 | /** 44 | * Get the type of this conversation 45 | */ 46 | @Override 47 | public int getType() 48 | { 49 | return Conversation.TYPE_CHANNEL; 50 | } 51 | 52 | /** 53 | * Set the channel's topic 54 | * 55 | * @param topic The topic of the channel 56 | */ 57 | public void setTopic(String topic) 58 | { 59 | this.topic = topic; 60 | } 61 | 62 | /** 63 | * Get the topic of the channel 64 | * 65 | * @return The channel's topic 66 | */ 67 | public String getTopic() 68 | { 69 | return topic; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Extra.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * Helper class for constants used for bundle params (extras) 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class Extra 29 | { 30 | public static final String SERVER = "server"; 31 | public static final String CONVERSATION = "conversation"; 32 | public static final String USERS = "users"; 33 | 34 | public static final String ALIASES = "aliases"; 35 | public static final String CHANNELS = "channels"; 36 | public static final String COMMANDS = "commands"; 37 | public static final String MESSAGE = "message"; 38 | public static final String USER = "user"; 39 | public static final String ACTION = "action"; 40 | 41 | public static final String NICKSERV_PASSWORD = "nickserv_password"; 42 | public static final String SASL_USER = "sasl_user"; 43 | public static final String SASL_PASSWORD = "sasl_password"; 44 | 45 | public static final String CONNECT = "connect"; 46 | public static final String SERVER_ID = "serverId"; 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Query.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * A query (a private chat between to users) 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class Query extends Conversation 29 | { 30 | /** 31 | * Create a new query 32 | * 33 | * @param name The user's nickname 34 | */ 35 | public Query(String name) 36 | { 37 | super(name); 38 | } 39 | 40 | /** 41 | * Get the type of this conversation 42 | */ 43 | @Override 44 | public int getType() 45 | { 46 | return Conversation.TYPE_QUERY; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Scrollback.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | import java.util.LinkedList; 24 | 25 | /** 26 | * Class for handling the scrollback history 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public class Scrollback 31 | { 32 | public static final int MAX_HISTORY = 10; 33 | 34 | private final LinkedList messages; 35 | private int pointer; 36 | 37 | /** 38 | * Create a new scrollback object 39 | */ 40 | public Scrollback() 41 | { 42 | messages = new LinkedList(); 43 | } 44 | 45 | /** 46 | * Add a message to the history 47 | */ 48 | public void addMessage(String message) 49 | { 50 | messages.addLast(message); 51 | 52 | if (messages.size() > MAX_HISTORY) { 53 | messages.removeFirst(); 54 | } 55 | 56 | pointer = messages.size(); 57 | } 58 | 59 | /** 60 | * Go back in history 61 | * 62 | * @return 63 | */ 64 | public String goBack() 65 | { 66 | if (pointer > 0) { 67 | pointer--; 68 | } 69 | 70 | if (messages.size() > 0) { 71 | return messages.get(pointer); 72 | } 73 | 74 | return null; 75 | } 76 | 77 | /** 78 | * Go forward in history 79 | * 80 | * @return 81 | */ 82 | public String goForward() 83 | { 84 | if (pointer < messages.size() - 1) { 85 | pointer++; 86 | } else { 87 | return ""; 88 | } 89 | 90 | if (messages.size() > 0) { 91 | return messages.get(pointer); 92 | } 93 | 94 | return null; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/ServerInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * ServerInfo for all messages regarding the server 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class ServerInfo extends Conversation 29 | { 30 | public static final String DEFAULT_NAME = ""; 31 | 32 | /** 33 | * Create a new ServerInfo object 34 | * 35 | * @param name 36 | */ 37 | public ServerInfo() 38 | { 39 | super(DEFAULT_NAME); 40 | } 41 | 42 | /** 43 | * Get the type of this conversation 44 | */ 45 | @Override 46 | public int getType() 47 | { 48 | return Conversation.TYPE_SERVER; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * Helper class for server status constants 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class Status 29 | { 30 | public static final int DISCONNECTED = 0; 31 | public static final int CONNECTING = 1; 32 | public static final int CONNECTED = 2; 33 | public static final int PRE_CONNECTING = 3; 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/model/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.model; 22 | 23 | /** 24 | * Helper class for anything regarding users 25 | * 26 | * @author Sebastian Kaspari 27 | */ 28 | public class User 29 | { 30 | public static final int ACTION_REPLY = 1; 31 | public static final int ACTION_QUERY = 2; 32 | public static final int ACTION_OP = 3; 33 | public static final int ACTION_DEOP = 4; 34 | public static final int ACTION_VOICE = 5; 35 | public static final int ACTION_DEVOICE = 6; 36 | public static final int ACTION_KICK = 7; 37 | public static final int ACTION_BAN = 8; 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/receiver/ConversationReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.receiver; 22 | 23 | import org.yaaic.listener.ConversationListener; 24 | import org.yaaic.model.Broadcast; 25 | import org.yaaic.model.Extra; 26 | 27 | import android.content.BroadcastReceiver; 28 | import android.content.Context; 29 | import android.content.Intent; 30 | 31 | /** 32 | * A channel receiver for receiving channel updates 33 | * 34 | * @author Sebastian Kaspari 35 | */ 36 | public class ConversationReceiver extends BroadcastReceiver 37 | { 38 | private final ConversationListener listener; 39 | private final int serverId; 40 | 41 | /** 42 | * Create a new channel receiver 43 | * 44 | * @param serverId Only listen on channels of this server 45 | * @param listener 46 | */ 47 | public ConversationReceiver(int serverId, ConversationListener listener) 48 | { 49 | this.listener = listener; 50 | this.serverId = serverId; 51 | } 52 | 53 | /** 54 | * On receive broadcast 55 | * 56 | * @param context 57 | * @param intent 58 | */ 59 | @Override 60 | public void onReceive(Context context, Intent intent) 61 | { 62 | int serverId = intent.getExtras().getInt(Extra.SERVER); 63 | if (serverId != this.serverId) { 64 | return; 65 | } 66 | 67 | String action = intent.getAction(); 68 | 69 | if (action.equals(Broadcast.CONVERSATION_MESSAGE)) { 70 | listener.onConversationMessage(intent.getExtras().getString(Extra.CONVERSATION)); 71 | } else if (action.equals(Broadcast.CONVERSATION_NEW)) { 72 | listener.onNewConversation(intent.getExtras().getString(Extra.CONVERSATION)); 73 | } else if (action.equals(Broadcast.CONVERSATION_REMOVE)) { 74 | listener.onRemoveConversation(intent.getExtras().getString(Extra.CONVERSATION)); 75 | } else if (action.equals(Broadcast.CONVERSATION_TOPIC)) { 76 | listener.onTopicChanged(intent.getExtras().getString(Extra.CONVERSATION)); 77 | } 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/receiver/ReconnectReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | Copyright 2011 Steven Luo 6 | 7 | This file is part of Yaaic. 8 | 9 | Yaaic is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Yaaic is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Yaaic. If not, see . 21 | */ 22 | package org.yaaic.receiver; 23 | 24 | import org.yaaic.irc.IRCService; 25 | import org.yaaic.model.Broadcast; 26 | import org.yaaic.model.Server; 27 | 28 | import android.content.BroadcastReceiver; 29 | import android.content.Context; 30 | import android.content.Intent; 31 | 32 | /** 33 | * A receiver to listen for alarms and start a reconnect attempt 34 | * 35 | * @author Steven Luo 36 | */ 37 | public class ReconnectReceiver extends BroadcastReceiver 38 | { 39 | private IRCService service; 40 | private Server server; 41 | 42 | /** 43 | * Create a new reconnect receiver 44 | * 45 | * @param server The server to reconnect to 46 | */ 47 | public ReconnectReceiver(IRCService service, Server server) 48 | { 49 | this.service = service; 50 | this.server = server; 51 | } 52 | 53 | /** 54 | * On receive broadcast 55 | */ 56 | @Override 57 | public void onReceive(Context context, Intent intent) 58 | { 59 | if (!intent.getAction().equals(Broadcast.SERVER_RECONNECT + server.getId())) { 60 | return; 61 | } 62 | service.connect(server); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/receiver/ServerReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.receiver; 22 | 23 | import org.yaaic.listener.ServerListener; 24 | 25 | import android.content.BroadcastReceiver; 26 | import android.content.Context; 27 | import android.content.Intent; 28 | 29 | /** 30 | * A server receiver for receiving server updates 31 | * 32 | * @author Sebastian Kaspari 33 | */ 34 | public class ServerReceiver extends BroadcastReceiver 35 | { 36 | private final ServerListener listener; 37 | 38 | /** 39 | * Create a new server receiver 40 | * 41 | * @param listener 42 | */ 43 | public ServerReceiver(ServerListener listener) 44 | { 45 | this.listener = listener; 46 | } 47 | 48 | /** 49 | * On receive broadcast 50 | */ 51 | @Override 52 | public void onReceive(Context context, Intent intent) 53 | { 54 | listener.onStatusUpdate(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/utils/DisplayUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.utils; 22 | 23 | import android.content.Context; 24 | 25 | /** 26 | * Helper class for methods regarding the display of the current device. 27 | * 28 | * @author Sebastian Kaspari 29 | */ 30 | public class DisplayUtils 31 | { 32 | private static float density = -1; 33 | 34 | /** 35 | * Convert the given density-independent pixels into real pixels for the 36 | * display of the device. 37 | * 38 | * @param dp 39 | * @return 40 | */ 41 | public static int convertToPixels(Context context, int dp) { 42 | float density = getScreenDensity(context); 43 | 44 | return (int) (dp * density + 0.5f); 45 | } 46 | 47 | /** 48 | * Get the density of the display of the device. 49 | * 50 | * @param context 51 | * @return 52 | */ 53 | public static float getScreenDensity(Context context) { 54 | if (density == -1) { 55 | density = context.getResources().getDisplayMetrics().density; 56 | } 57 | 58 | return density; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/org/yaaic/view/MessageListView.java: -------------------------------------------------------------------------------- 1 | /* 2 | Yaaic - Yet Another Android IRC Client 3 | 4 | Copyright 2009-2013 Sebastian Kaspari 5 | 6 | This file is part of Yaaic. 7 | 8 | Yaaic is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Yaaic is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Yaaic. If not, see . 20 | */ 21 | package org.yaaic.view; 22 | 23 | import org.yaaic.R; 24 | import org.yaaic.adapter.MessageListAdapter; 25 | import org.yaaic.listener.MessageClickListener; 26 | 27 | import android.content.Context; 28 | import android.widget.ListView; 29 | 30 | /** 31 | * A customized ListView for Messages 32 | * 33 | * @author Sebastian Kaspari 34 | */ 35 | public class MessageListView extends ListView 36 | { 37 | /** 38 | * Create a new MessageListView 39 | * 40 | * @param context 41 | */ 42 | public MessageListView(Context context) 43 | { 44 | super(context); 45 | 46 | setOnItemClickListener(MessageClickListener.getInstance()); 47 | 48 | setDivider(null); 49 | 50 | setCacheColorHint(0xFFFFFFFF); 51 | setVerticalFadingEdgeEnabled(false); 52 | setScrollBarStyle(SCROLLBARS_OUTSIDE_INSET); 53 | 54 | // Scale padding by screen density 55 | float density = context.getResources().getDisplayMetrics().density; 56 | int padding = (int) (5 * density); 57 | setPadding(padding, padding, padding, padding); 58 | 59 | setTranscriptMode(TRANSCRIPT_MODE_NORMAL); 60 | } 61 | 62 | /** 63 | * Get the adapter of this MessageListView 64 | * (Helper to avoid casting) 65 | * 66 | * @return The MessageListAdapter 67 | */ 68 | @Override 69 | public MessageListAdapter getAdapter() 70 | { 71 | return (MessageListAdapter) super.getAdapter(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/animator/fab_state_list_animator.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 32 | 33 | 34 | 35 | 36 | 41 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/actionbar_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/actionbar_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/actionbar_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/actionbar_users.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_action_discard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_action_done.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_action_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_action_send.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_overview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_server_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_server_connected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_server_disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_server_disconnected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_navigation_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_navigation_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-hdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_ban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_ban.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_blank.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_deop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_deop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_devoice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_devoice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_kick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_kick.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_op.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_op.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_query.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_reply.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/action_voice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/action_voice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/actionbar_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/actionbar_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/actionbar_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/actionbar_users.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_action_discard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_action_done.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_action_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_action_send.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_overview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_server_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_server_connected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_server_disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_server_disconnected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_navigation_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_navigation_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/join.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/menu_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/menu_users.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/op.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/op.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/part.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/part.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/quit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/unknown_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/unknown_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/user_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/user_title.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/voice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/voice.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-mdpi/warning.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/actionbar_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/actionbar_users.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_action_discard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_action_done.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_action_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_action_send.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_overview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_server_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_server_connected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_server_disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_server_disconnected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_navigation_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_navigation_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xhdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_action_discard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_action_done.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_action_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_action_send.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_overview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_server_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_server_connected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_server_disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_server_disconnected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_navigation_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pocmo/Yaaic/d4a10b6c9c9d5211ed4ea650d5d54269df868175/app/src/main/res/drawable-xxhdpi/ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/fab_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/navigation_item_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/plus.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/about.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 27 | 28 | 35 | 36 | 42 | 43 | 49 | 50 | 56 | 57 | 65 | 66 | 77 | 78 | 83 | 84 | -------------------------------------------------------------------------------- /app/src/main/res/layout/actionitem.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 27 | 33 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 27 | 28 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/aliasadd.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 27 | 32 | 36 | 40 | 46 |