mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Separate command line stuff from program.
This commit is contained in:
@@ -72,13 +72,8 @@ public class MrMailbox {
|
||||
return MrMailboxGetConfigInt(m_hMailbox, key, def);
|
||||
}
|
||||
|
||||
public static String getInfo() {
|
||||
return MrMailboxGetInfo(m_hMailbox);
|
||||
}
|
||||
|
||||
public static String execute(String cmd) {
|
||||
return MrMailboxExecute(m_hMailbox, cmd);
|
||||
}
|
||||
public native static String getInfo();
|
||||
public native static String cmdline(String cmd);
|
||||
|
||||
private static long m_hMailbox = 0; // do not rename this, is used in C-part
|
||||
private native static long MrMailboxNew (); // returns hMailbox which must be unref'd after usage (Names as mrmailbox_new don't work due to the additional underscore)
|
||||
@@ -90,9 +85,6 @@ public class MrMailbox {
|
||||
private native static int MrMailboxSetConfig (long hMailbox, String key, String value); // value may be NULL
|
||||
private native static String MrMailboxGetConfig (long hMailbox, String key, String def); // def may be NULL, returns empty string as NULL
|
||||
private native static int MrMailboxGetConfigInt (long hMailbox, String key, int def); // def may be NULL, returns empty string as NULL
|
||||
private native static String MrMailboxGetInfo (long hMailbox);
|
||||
private native static String MrMailboxExecute (long hMailbox, String cmd);
|
||||
|
||||
|
||||
// contacts
|
||||
public native static int[] getKnownContacts(String query);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class NameSettingsActivity extends BaseFragment {
|
||||
|
||||
if( v.length()>=1 && v.charAt(0)=='.') {
|
||||
String cmd = v.substring(1);
|
||||
String execute_result = MrMailbox.execute(cmd);
|
||||
String execute_result = MrMailbox.cmdline(cmd);
|
||||
if( execute_result==null || execute_result.isEmpty()) {
|
||||
execute_result = "ERROR: Unknown command.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user