Index: bombus-plus/export/trunk/nbproject/project.properties =================================================================== --- bombus-plus/export/trunk/nbproject/project.properties (revision 1288) +++ bombus-plus/export/trunk/nbproject/project.properties (working copy) @@ -1,9 +1,9 @@ -abilities=MIDP2,LOCALE_DEBUG=,SASL=,TRANSLATED=,FILE_IO=,DISABLE_AUTOFOCUS=,MOTOROLA_BACKLIGHT=,COLOR_THEMES=,ZLIB=,USE_UTF8_READER=,FILE_TRANSFER=,OUTSTREAM_FLUSH,SASL_XGOOGLETOKEN= +abilities=FILE_TRANSFER=,MOTOROLA_BACKLIGHT=,ZLIB=,DISABLE_AUTOFOCUS=,LOCALE_DEBUG=,SASL_XGOOGLETOKEN=,OUTSTREAM_FLUSH,FILE_IO=,ARCHIVE_ADVANCED=,USE_UTF8_READER=,COLOR_THEMES=,MIDP2 build.classes.dir=${build.dir}/compiled build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd build.dir=build/${config.active} build.root.dir=build -configs.Release.abilities=MIDP2,USE_UTF8_READER,SASL=,TRANSLATED=,MEM_STAT,MOTOROLA_BACKLIGHT=,OUTSTREAM_FLUSH,SASL_XGOOGLETOKEN= +configs.Release.abilities=SASL_XGOOGLETOKEN=,OUTSTREAM_FLUSH,XML_STREAM_DEBUG=,MOTOROLA_BACKLIGHT=,TRANSLATED=,USE_UTF8_READER,MIDP2 configs.Release.deployment.copy.target=ftp/midp2.0 configs.Release.deployment.ftp.passive=false configs.Release.deployment.ftp.password= @@ -38,10 +38,85 @@ configs.Release.libs.classpath=resources/text;resources/MIDP2 configs.Release.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n configs.Release.manifest.manifest= -configs.Release.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\nMIDlet-Name: Bombus\n +configs.Release.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n configs.Release.obfuscation.custom= configs.Release.obfuscation.level=9 -configs.ReleaseJZLIB.abilities=MIDP2,SASL=,FILE_IO=,TRANSLATED=,MEM_STAT,SIEMENS_BACKLIGHT=,MOTOROLA_BACKLIGHT=,COLOR_THEMES=,ZLIB=,USE_UTF8_READER,FILE_TRANSFER=,OUTSTREAM_FLUSH,SASL_XGOOGLETOKEN= +configs.ReleaseZVOFFK.abilities=_MAX_COMPRESSION=,_HTTPCONNECT=,FILE_TRANSFER=,ZLIB=,MOTOROLA_BACKLIGHT=,_XML_STREAM_DEBUG=,TRAFFIC=,OUTSTREAM_FLUSH,_NONSASL_ENABLE=,FILE_IO=,ARCHIVE_ADVANCED=,USE_UTF8_READER,COLOR_THEMES=,_LOCALE_DEBUG= +configs.ReleaseZVOFFK.deployment.copy.target=${file.reference.midp2.0z} +configs.ReleaseZVOFFK.deployment.ftp.passive=false +configs.ReleaseZVOFFK.deployment.ftp.password= +configs.ReleaseZVOFFK.deployment.ftp.port=21 +configs.ReleaseZVOFFK.deployment.ftp.remotedir= +configs.ReleaseZVOFFK.deployment.ftp.separator=/ +configs.ReleaseZVOFFK.deployment.ftp.server= +configs.ReleaseZVOFFK.deployment.ftp.userid= +configs.ReleaseZVOFFK.deployment.jarurl=http://bombus-im.org/builds/beta/midp2.0z/${dist.jar} +configs.ReleaseZVOFFK.deployment.method=Copy +configs.ReleaseZVOFFK.deployment.override.jarurl=true +configs.ReleaseZVOFFK.deployment.scp.keyfile=${file.reference.svn-trunk} +configs.ReleaseZVOFFK.deployment.scp.passphrase= +configs.ReleaseZVOFFK.deployment.scp.password= +configs.ReleaseZVOFFK.deployment.scp.port=22 +configs.ReleaseZVOFFK.deployment.scp.remotedir= +configs.ReleaseZVOFFK.deployment.scp.server= +configs.ReleaseZVOFFK.deployment.scp.usekeyfile=no +configs.ReleaseZVOFFK.deployment.scp.userid= +configs.ReleaseZVOFFK.deployment.webdav.password= +configs.ReleaseZVOFFK.deployment.webdav.port=80 +configs.ReleaseZVOFFK.deployment.webdav.remotedir= +configs.ReleaseZVOFFK.deployment.webdav.server= +configs.ReleaseZVOFFK.deployment.webdav.userid= +configs.ReleaseZVOFFK.javac.debug=false +configs.ReleaseZVOFFK.javac.deprecation=true +configs.ReleaseZVOFFK.javac.encoding=Cp1251 +configs.ReleaseZVOFFK.javac.optimize=true +configs.ReleaseZVOFFK.libs.classpath=resources/zlib;resources/text;resources/MIDP2_ReleaseZVOFFK;resources/themes_ReleaseZVOFFK +configs.ReleaseZVOFFK.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n +configs.ReleaseZVOFFK.manifest.manifest= +configs.ReleaseZVOFFK.manifest.midlets=MIDlet-1: Bombus+,/_icon.png,midlet.Bombus\n +configs.ReleaseZVOFFK.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n +configs.ReleaseZVOFFK.obfuscation.custom= +configs.ReleaseZVOFFK.obfuscation.level=9 +configs.ReleaseZLITE.abilities=SASL_XGOOGLETOKEN=,OUTSTREAM_FLUSH,MEM_STAT,MOTOROLA_BACKLIGHT=,TRANSLATED=,USE_UTF8_READER,MIDP2 +configs.ReleaseZLITE.debug.level=debug +configs.ReleaseZLITE.deployment.copy.target=${file.reference.midp2.0} +configs.ReleaseZLITE.deployment.ftp.passive=false +configs.ReleaseZLITE.deployment.ftp.password= +configs.ReleaseZLITE.deployment.ftp.port=21 +configs.ReleaseZLITE.deployment.ftp.remotedir= +configs.ReleaseZLITE.deployment.ftp.separator=/ +configs.ReleaseZLITE.deployment.ftp.server= +configs.ReleaseZLITE.deployment.ftp.userid= +configs.ReleaseZLITE.deployment.jarurl=http://bombus.jrudevels.org/builds/beta/midp2.0/${dist.jar} +configs.ReleaseZLITE.deployment.method=Copy +configs.ReleaseZLITE.deployment.override.jarurl=true +configs.ReleaseZLITE.deployment.scp.keyfile=${file.reference.bombus-bombus-plus} +configs.ReleaseZLITE.deployment.scp.passphrase= +configs.ReleaseZLITE.deployment.scp.password= +configs.ReleaseZLITE.deployment.scp.port=22 +configs.ReleaseZLITE.deployment.scp.remotedir= +configs.ReleaseZLITE.deployment.scp.server= +configs.ReleaseZLITE.deployment.scp.usekeyfile=no +configs.ReleaseZLITE.deployment.scp.userid= +configs.ReleaseZLITE.deployment.webdav.password= +configs.ReleaseZLITE.deployment.webdav.port=80 +configs.ReleaseZLITE.deployment.webdav.remotedir= +configs.ReleaseZLITE.deployment.webdav.server= +configs.ReleaseZLITE.deployment.webdav.userid= +configs.ReleaseZLITE.filter.exclude.tests=false +configs.ReleaseZLITE.filter.excludes=archive/DebugDumpArchive.java,io/file,io/file/**,ui/ScreenManager.java,Messages/MessageView.java,com/alsutton/jabber/datablocks/IqGetVCard.java,com/jcraft,com/jcraft/** +configs.ReleaseZLITE.filter.use.standard=true +configs.ReleaseZLITE.javac.debug=false +configs.ReleaseZLITE.javac.deprecation=true +configs.ReleaseZLITE.javac.encoding=Cp1251 +configs.ReleaseZLITE.javac.optimize=true +configs.ReleaseZLITE.libs.classpath=resources/MIDP2_ReleaseZLITE;resources/text_ReleaseZLITE +configs.ReleaseZLITE.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n +configs.ReleaseZLITE.manifest.manifest= +configs.ReleaseZLITE.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n +configs.ReleaseZLITE.obfuscation.custom= +configs.ReleaseZLITE.obfuscation.level=9 +configs.ReleaseJZLIB.abilities=_MAX_COMPRESSION=,FILE_TRANSFER=,_HTTPCONNECT=,MOTOROLA_BACKLIGHT=,ZLIB=,_XML_STREAM_DEBUG=,TRAFFIC=,SASL_XGOOGLETOKEN=,OUTSTREAM_FLUSH,_NONSASL_ENABLE=,FILE_IO=,LIGHT_CONTROL=,ARCHIVE_ADVANCED=,USE_UTF8_READER,COLOR_THEMES=,_LOCALE_DEBUG= configs.ReleaseJZLIB.deployment.copy.target=ftp/midp2.0z configs.ReleaseJZLIB.deployment.ftp.passive=false configs.ReleaseJZLIB.deployment.ftp.password= @@ -70,22 +145,14 @@ configs.ReleaseJZLIB.javac.deprecation=true configs.ReleaseJZLIB.javac.encoding=Cp1251 configs.ReleaseJZLIB.javac.optimize=true -configs.ReleaseJZLIB.libs.classpath=resources/zlib;resources/text;resources/MIDP2 configs.ReleaseJZLIB.libs.classpath=resources/zlib;resources/text;resources/MIDP2;resources/themes configs.ReleaseJZLIB.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n configs.ReleaseJZLIB.manifest.manifest= -configs.ReleaseJZLIB.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Name: Bombus\nMIDlet-Version: $MIDLETVERSION$\n +configs.ReleaseJZLIB.manifest.midlets=MIDlet-1: Bombus+,/_icon.png,midlet.Bombus\n +configs.ReleaseJZLIB.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n configs.ReleaseJZLIB.obfuscation.custom= configs.ReleaseJZLIB.obfuscation.level=9 -configs.ReleaseJZLIB.platform.active=J2ME_Wireless_Toolkit_2_2 -configs.ReleaseJZLIB.platform.active.description=J2ME Wireless Toolkit 2.2 -configs.ReleaseJZLIB.platform.apis=JSR75-1.0,JSR172-1.0,JSR82-1.0,JSR184-1.0,MMAPI-1.1,WMA-2.0 -configs.ReleaseJZLIB.platform.bootclasspath=${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/cldcapi10.jar:${platform.home}/lib/midpapi20.jar -configs.ReleaseJZLIB.bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar -configs.ReleaseJZLIB.platform.configuration=CLDC-1.0 -configs.ReleaseJZLIB.platform.device=MediaControlSkin -configs.ReleaseJZLIB.platform.profile=MIDP-2.0 -configs.ReleaseZH.abilities=MIDP2,SASL=,FILE_IO=,TRANSLATED=,MEM_STAT,MOTOROLA_BACKLIGHT=,SIEMENS_BACKLIGHT=,COLOR_THEMES=,ZLIB=,USE_UTF8_READER,FILE_TRANSFER=,OUTSTREAM_FLUSH,SASL_XGOOGLETOKEN= +configs.ReleaseZH.abilities=MEM_STAT,FILE_TRANSFER=,MOTOROLA_BACKLIGHT=,ZLIB=,SIEMENS_BACKLIGHT=,TRANSLATED=,SASL_XGOOGLETOKEN=,OUTSTREAM_FLUSH,FILE_IO=,LIGHT_CONTROL=,ARCHIVE_ADVANCED=,USE_UTF8_READER,COLOR_THEMES=,MIDP2 configs.ReleaseZH.deployment.copy.target=ftp/midp2.0zh configs.ReleaseZH.deployment.ftp.passive=false configs.ReleaseZH.deployment.ftp.password= @@ -118,7 +185,7 @@ configs.ReleaseZH.manifest.apipermissions=MIDlet-Permissions: javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write, javax.microedition.io.Connector.http, javax.microedition.io.Connector.https, javax.microedition.io.Connector.ssl, javax.microedition.io.Connector.socket, javax.microedition.io.Connector.serversocket, javax.microedition.io.PushRegistry, javax.microedition.media.control.VideoControl.getSnapshot, javax.microedition.pim.ContactList.read, javax.microedition.pim.ContactList.write, javax.microedition.pim.EventList.read, javax.microedition.pim.EventList.write\n configs.ReleaseZH.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n configs.ReleaseZH.manifest.manifest= -configs.ReleaseZH.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Name: Bombus\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n +configs.ReleaseZH.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n configs.ReleaseZH.obfuscation.custom= configs.ReleaseZH.obfuscation.level=9 configs.ReleaseZH.platform.active=Sun_Java_TM__Wireless_Toolkit_2_5_1_for_CLDC @@ -130,7 +197,7 @@ configs.ReleaseZH.platform.profile=MIDP-2.0 configs.ReleaseZH.sign.alias=halmer configs.ReleaseZH.sign.enabled=true -configs.ReleaseZH.sign.keystore=${file.reference.keystore.ks} +configs.ReleaseZH.sign.keystore==${file.reference.keystore.ks} configs.ReleaseZH.sign.keystorehalmer/keystore.ks deployment.copy.target=${file.reference.-TEMP_WIN} deployment.jarurl=${dist.jar} @@ -173,7 +240,7 @@ manifest.jad=Bombus-Version: $BOMBUSVERSION$\n manifest.manifest= manifest.midlets=MIDlet-1: Bombus,/_icon.png,midlet.Bombus\n -manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Version: $MIDLETVERSION$\nMIDlet-Name: Bombus\n +manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Version: $MIDLETVERSION$\n manifest.pushregistry= name=Bombus no.dependencies=false @@ -184,9 +251,9 @@ obfuscator.srcjar=${build.dir}/before-obfuscation.jar platform.active=J2ME_Wireless_Toolkit_2_2 platform.active.description=J2ME Wireless Toolkit 2.2 -platform.apis=JSR75-1.0,JSR172-1.0,JSR82-1.0,JSR184-1.0,MMAPI-1.1,OBEX-1.0,WMA-2.0 -bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar -platform.bootclasspath=${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/cldcapi10.jar:${platform.home}/lib/midpapi20.jar +platform.apis=JSR75-1.0,MMAPI-1.1,WMA-2.0 +bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar:bootclasspath/nokialightapi.jar +platform.bootclasspath=${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/midpapi20.jar:${platform.home}/lib/cldcapi10.jar platform.configuration=CLDC-1.0 platform.device=DefaultColorPhone platform.profile=MIDP-2.0 Index: bombus-plus/export/trunk/nbproject/project.xml =================================================================== --- bombus-plus/export/trunk/nbproject/project.xml (revision 1288) +++ bombus-plus/export/trunk/nbproject/project.xml (working copy) @@ -5,10 +5,12 @@ ReleaseJZLIB ReleaseZH + ReleaseZLITE + ReleaseZVOFFK Release - Bombus + Bombus+ 1.6 Index: bombus-plus/export/trunk/nbproject/private/private.properties =================================================================== --- bombus-plus/export/trunk/nbproject/private/private.properties (revision 1288) +++ bombus-plus/export/trunk/nbproject/private/private.properties (working copy) @@ -1,7 +1,11 @@ #Sun Nov 18 18:59:37 GMT 2007 file.reference.-TEMP_WIN=D\:\\TEMP_WIN -netbeans.user=C\:\\Documents and Settings\\evgs\\.netbeans\\5.5 +file.reference.bombus-bombus-plus=D:\\TOOLS\\bombus\\bombus-plus +file.reference.builtin.ks=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1\\config\\j2me\\builtin.ks +file.reference.builtin.ks-1=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1\\config\\j2me\\builtin.ks +file.reference.midp2.0=D:\\TOOLS\\bombus\\bombus-plus\\ftp\\midp2.0 +netbeans.user=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1 javadoc.preview=true deployment.counter=000570 -config.active= +config.active=ReleaseJZLIB deployment.number=0.5.69 Index: bombus-plus/export/trunk/src/archive/MessageArchive.java =================================================================== --- bombus-plus/export/trunk/src/archive/MessageArchive.java (revision 1288) +++ bombus-plus/export/trunk/src/archive/MessageArchive.java (working copy) @@ -132,4 +132,26 @@ //new MessageArchive() } catch (Exception e) { e.printStackTrace(); } } + + public void deleteAll() {// + try { + int i=-1; + int num=rs.getNumRecords(); + while (true) { + i=i+1; + rs.deleteRecord(getRecordId(i)); + if (num==i) break; + } + } catch (Exception e) {} + try { + indexes.removeAllElements(); + } catch (Exception e) {} + } + +// public void add(Msg msg) { // +// try { +// store(msg); +// indexes.insertElementAt(msg, 0); +// } catch (Exception e) {} +// } } Index: bombus-plus/export/trunk/src/archive/ArchiveList.java =================================================================== --- bombus-plus/export/trunk/src/archive/ArchiveList.java (revision 1288) +++ bombus-plus/export/trunk/src/archive/ArchiveList.java (working copy) @@ -37,10 +37,29 @@ import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; -import javax.microedition.lcdui.TextBox; +//import javax.microedition.lcdui.TextBox; import locale.SR; -import ui.ComplexString; +//import ui.ComplexString; import ui.YesNoAlert; +//import util.ClipBoard; +//#if ARCHIVE_ADVANCED +// +import Client.Contact; +import Client.Groups; +import Client.StaticData; +import java.util.Enumeration; + //#if FILE_IO +import io.file.FileIO; +import io.file.browse.Browser; +import io.file.browse.BrowserListener; +import java.io.InputStream; +import java.io.IOException; +import java.io.OutputStream; +import Client.Config; +import ui.Time; +import util.strconv; + //#endif +//#endif /** * @@ -49,18 +68,62 @@ public class ArchiveList extends MessageList implements YesNoAlert.YesNoListener +//#if (FILE_IO && ARCHIVE_ADVANCED) + , BrowserListener +//#endif { Command cmdDelete=new Command(SR.MS_DELETE /*"Delete"*/, Command.SCREEN, 9); - Command cmdPaste=new Command(SR.MS_PASTE_BODY /*"Paste Body"*/, Command.SCREEN, 1); - Command cmdSubj=new Command(SR.MS_PASTE_SUBJECT /*"Paste Subject"*/, Command.SCREEN, 3); - Command cmdJid=new Command(SR.MS_PASTE_JID /*"Paste Jid"*/, Command.SCREEN, 2); + Command cmdPaste=new Command(SR.MS_PASTE, Command.SCREEN, 1); // + Command cmdPasteSpecial=new Command(SR.MS_PASTE_SPECIAL, Command.SCREEN, 2); // + //Command cmdSubj=new Command(SR.MS_PASTE_SUBJECT /*"Paste Subject"*/, Command.SCREEN, 3); + Command cmdJid=new Command(SR.MS_PASTE_JID /*"Paste Jid"*/, Command.SCREEN, 3); // //Command cmdNick=new Command("Paste Nickname", Command.SCREEN, 3); + Command cmdEdit=new Command(SR.MS_EDIT, Command.SCREEN, 14); // + Command cmdNew=new Command(SR.MS_NEW_MESSAGE, Command.SCREEN, 15); // + //Command cmdCopy = new Command(SR.MS_COPY, Command.SCREEN, 16); + //Command cmdCopyPlus = new Command("+ "+SR.MS_COPY, Command.SCREEN, 16); +//#if ARCHIVE_ADVANCED + //#if (FILE_IO) + Command cmdExport=new Command(SR.MS_MAKE_BACKUP, Command.SCREEN, 17); + Command cmdImport=new Command(SR.MS_IMPORT_FROM_BACKUP, Command.SCREEN, 18); + //#endif + Command cmdExportRoster=new Command("Roster->archive", Command.SCREEN, 19); + private StaticData sd=StaticData.getInstance(); +//#endif + Command cmdDeleteAll=new Command("Delete all!", Command.SCREEN, 20); // + byte yesNoAction=0; // MessageArchive archive=new MessageArchive(); MessageEdit target; + private int caretPos; + //private ClipBoard clipboard=ClipBoard.getInstance(); +//#if FILE_IO + private final static int EXPORT=0; + private final static int IMPORT=1; - private int caretPos; + private int filePos; + private FileIO file; + private OutputStream os; + + private int returnVal=0; + + private String start_item=""; + private String end_item=""; + + private String start_date=""; + private String end_date=""; + + private String start_from=""; + private String end_from=""; + + private String start_subj=""; + private String end_subj=""; + + private String start_body=""; + private String end_body=""; +//#endif + /** Creates a new instance of ArchiveList */ public ArchiveList(Display display, MessageEdit target, int caretPos) { super (); @@ -69,12 +132,23 @@ setCommandListener(this); addCommand(cmdBack); addCommand(cmdDelete); - + addCommand(cmdEdit); // + addCommand(cmdNew); // + addCommand(cmdDeleteAll); // +//#if ARCHIVE_ADVANCED + //#if (FILE_IO) + addCommand(cmdExport); + addCommand(cmdImport); + //#endif + addCommand(cmdExportRoster); +//#endif + if (target!=null) { addCommand(cmdPaste); + addCommand(cmdPasteSpecial); addCommand(cmdJid); //TODO: re-enable item-specific dynamic commands) - addCommand(cmdSubj); + //addCommand(cmdSubj); } attachDisplay(display); @@ -88,14 +162,14 @@ title.addElement(null); title.addRAlign(); title.addElement(null); - title.addElement(SR.MS_FREE /*"free "*/); + title.addElement(/*SR.MS_FREE*/ "free "); // setTitleItem(title); } protected void beginPaint() { getTitleItem().setElementAt(" ("+String.valueOf(getItemCount())+")",1); - getTitleItem().setElementAt(String.valueOf(archive.freeSpace()),3); + getTitleItem().setElementAt(String.valueOf(archive.freeSpace())+" kb",3); } public int getItemCount() { @@ -108,19 +182,81 @@ public void commandAction(Command c, Displayable d) { super.commandAction(c,d); - if (c==cmdDelete) { deleteMessage(); } + //if (c==cmdDelete) { deleteMessage(); } + if (c==cmdDelete) { // + yesNoAction=1; + new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this); + } if (c==cmdPaste) { pasteData(0); } - if (c==cmdSubj) { pasteData(1); } + if (c==cmdPasteSpecial) { pasteData(1); } + //if (c==cmdSubj) { pasteData(1); } // if (c==cmdJid) { pasteData(2); } + if (c==cmdEdit) { // + try { + new ArchiveEdit(display, getMessage(cursor), true); + deleteMessage(); + } catch (Exception e) {/*no messages*/} + } + if (c==cmdNew) { // + new ArchiveEdit(display, new Msg(Msg.MESSAGE_TYPE_OUT, "me", null, null), false); + } + if (c==cmdDeleteAll) { // + yesNoAction=2; + new YesNoAlert(display, "Delete all!", "Are you sure want to delete all messages?", this); + } +//#if ARCHIVE_ADVANCED + //#if FILE_IO + if (c==cmdExport) { + returnVal=EXPORT; + new Browser(null, display, this, true); + } + if (c==cmdImport) { + returnVal=IMPORT; + new Browser(null, display, this, false); + } + //#endif + if (c==cmdExportRoster) { // + Vector hcontacts=sd.roster.getHContacts(); + StringBuffer dump=new StringBuffer(); + for (Enumeration e=hcontacts.elements(); e.hasMoreElements();){ + Contact k=(Contact) e.nextElement(); + /*int grpType=k.getGroupType(); + if (grpType==Groups.TYPE_NO_GROUP || grpType==Groups.TYPE_COMMON || grpType==Groups.TYPE_IGNORE || grpType==Groups.TYPE_TRANSP) {*/ + if ((k.origin==Contact.ORIGIN_ROSTER || k.origin==Contact.ORIGIN_ROSTERRES) && k.origin!=Contact.ORIGIN_CLONE && k.getGroupType()!=Groups.TYPE_SELF) { + /*JRU-PHP: + *These are the five columns: action, JID, name, subscription (none, to, from, both) and group name. + *Theyre comma-separated and if they contain commas theirselves, theyre additionally double-quoted. + */ + //+,jid,nick,subscription,group + dump.append("+,"); + dump.append( quoteCommas(k.getBareJid()) ); + dump.append(","); + dump.append((k.nick!=null)?quoteCommas(k.nick):""); + dump.append(","); + dump.append(k.subscr); + dump.append(","); + String grpName=k.getGroup().getName(); + dump.append((grpName!=SR.MS_TRANSPORTS && grpName!=SR.MS_GENERAL)?quoteCommas(grpName):""); + grpName=null; + dump.append("\r\n"); + } + } + //new ArchiveEdit(display, new Msg(Msg.MESSAGE_TYPE_OUT, "me", "Roster <"+sd.account.getBareJid()+"> for JRU-PHP", dump.toString()), false); //buffer size of some phones is small!!! + archive.store(new Msg(Msg.MESSAGE_TYPE_OUT, "me", "Roster <"+sd.account.getBareJid()+"> for JRU-PHP", dump.toString())); + destroyView(); + dump=null; + hcontacts=null; + } +//#endif } - + private void deleteMessage() { archive.delete(cursor); messages=new Vector(); redraw(); } - private void pasteData(int field) { + /*private void pasteData(int field) { // if (target==null) return; Msg m=getMessage(cursor); if (m==null) return; @@ -138,20 +274,62 @@ if (data==null) return; target.insertText(data, caretPos); destroyView(); + }*/ + + private void pasteData(int field) { // + if (target==null) return; + Msg m=getMessage(cursor); + if (m==null) return; + StringBuffer data=new StringBuffer(); + switch (field) { + case 1: + data.append(m.quoteString()); + data.append("\n~~~~~~~~~~~~~~~\n"); + break; + case 2: + data.append(m.from); + break; + default: + data.append(m.quoteString()); + } + if (data==null) return; + target.insertText(data.toString(), caretPos); + data=null; + destroyView(); } - + public void keyGreen() { pasteData(0); } public void userKeyPressed(int keyCode) { super.userKeyPressed(keyCode); - if (keyCode==keyClear) { - if (getItemCount()>0) new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this); + if (keyCode=='9') //+"~~~~~~~" + pasteData(1); + if (keyCode=='#') //paste nick + pasteData(2); + if (keyCode==keyClear || keyCode=='0') { //clear + if (getItemCount()>0) { + yesNoAction=1; + new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this); + } } } - public void ActionConfirmed() { - deleteMessage(); + + public void ActionConfirmed() {// + switch (yesNoAction) { + case 1: + deleteMessage(); + break; + case 2: + deleteAllMessages(); + break; + } } + private void deleteAllMessages() {// + archive.deleteAll(); + messages=new Vector(); + } + /*public void focusedItem(int index) { if (target==null) return; try { @@ -167,5 +345,162 @@ super.destroyView(); archive.close(); } + +//#if ARCHIVE_ADVANCED + private static String quoteCommas(String src) { + return ((src.indexOf(",")>-1)?"\""+src+"\"":src); + } + //#if FILE_IO + public Vector importData(String archPath) { + Vector vector=new Vector(); + byte[] bodyMessage; + String archive=""; + bodyMessage=readFile(archPath); + + if (bodyMessage!=null) { + if (Config.getInstance().cp1251) { + archive=strconv.convCp1251ToUnicode(new String(bodyMessage, 0, bodyMessage.length)); + } else { + archive=new String(bodyMessage, 0, bodyMessage.length); + } + } + + if (archive!=null) { + try { + int pos=0; + int start_pos=0; + int end_pos=0; + + while (true) { + String date=null; String from=null; String subj=null; String body=null; String tempstr=null; + start_pos=archive.indexOf(start_item,pos); end_pos=archive.indexOf(end_item,pos); + + if (start_pos>-1 && end_pos>-1) { + tempstr=archive.substring(start_pos+start_item.length(), end_pos); + date=findBlock(tempstr, start_date, end_date); + from=findBlock(tempstr, start_from, end_from); + subj=findBlock(tempstr, start_subj, end_subj); + body=findBlock(tempstr, start_body, end_body); + //System.out.println("["+date+"]"+from+": "+subj+" "+body+"\r\n"); + Msg msg = new Msg(Msg.MESSAGE_TYPE_IN, from, subj, body); + msg.setDayTime(date); + vector.insertElementAt(msg, 0); + } else + break; + + pos=end_pos+end_item.length(); + } + } catch (Exception e) { + System.out.println(e.toString()); + } + } + + bodyMessage=null; + archPath=null; + + return vector; + } + + private String findBlock(String source, String _start, String _end){ + String block = ""; + int start =source.indexOf(_start); int end = source.indexOf(_end); + if (start<0 || end<0) + return block; + return source.substring(start+_start.length(), end); + } + + public void exportData(String archPath) { + byte[] bodyMessage; + int items=getItemCount(); + StringBuffer body=new StringBuffer(); + + for(int i=0; i + private final static String strSrch="Search"; // + private final static String strCmds="Execute"; // private final int AD_HOC_INDEX=17; private Command cmdOk=new Command(SR.MS_BROWSE, Command.SCREEN, 1); private Command cmdRfsh=new Command(SR.MS_REFRESH, Command.SCREEN, 2); - private Command cmdFeatures=new Command(SR.MS_FEATURES, Command.SCREEN, 3); private Command cmdSrv=new Command(SR.MS_SERVER, Command.SCREEN, 10); + private Command cmdFeatures=new Command(SR.MS_FEATURES, Command.SCREEN, 20); //private Command cmdAdd=new Command(SR.MS_ADD_TO_ROSTER, Command.SCREEN, 11); //FS#464 => this string is commented in SR.java' private Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 98); - private Command cmdCancel=new Command(SR.MS_CANCEL, Command.EXIT, 99); - + private Command cmdCancel=new Command(SR.MS_CANCEL, Command.SCREEN, 99); + private StaticData sd=StaticData.getInstance(); private Vector items; @@ -204,7 +204,7 @@ if (!id.startsWith("disco")) return JabberBlockListener.BLOCK_REJECTED; if (data.getTypeAttribute().equals("error")) { - System.out.println(data.toString()); + //System.out.println(data.toString()); discoIcon=RosterIcons.ICON_ERROR_INDEX; titleUpdate(); //redraw(); @@ -260,8 +260,10 @@ String var=i.getAttribute("var"); features.addElement(var); //if (var.equals(NS_MUC)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_GCJOIN_INDEX, strJoin)); } - if (var.equals(NS_SRCH)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_SEARCH_INDEX, SR.MS_SEARCH)); } - if (var.equals(NS_REGS)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_REGISTER_INDEX, SR.MS_REGISTER)); } + //if (var.equals(NS_SRCH)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_SEARCH_INDEX, SR.MS_SEARCH)); } + //if (var.equals(NS_REGS)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_REGISTER_INDEX, SR.MS_REGISTER)); } + if (var.equals(NS_SRCH)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_SEARCH_INDEX, strSrch)); } + if (var.equals(NS_REGS)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_REGISTER_INDEX, strReg)); } if (var.equals(NS_GATE)) { gateway=true; } //if (var.equals(NODE_CMDS)) { cmds.addElement(new DiscoCommand(AD_HOC_INDEX,strCmds)); } } Index: bombus-plus/export/trunk/src/Info/InfoWindow.java =================================================================== --- bombus-plus/export/trunk/src/Info/InfoWindow.java (revision 1288) +++ bombus-plus/export/trunk/src/Info/InfoWindow.java (working copy) @@ -57,29 +57,16 @@ if (icon==null) icon=Image.createImage("/_icon.png"); form.append(icon); } catch (Exception e) { } + // form.append(Version.NAME+" v"+Version.version+"\nMobile Jabber client\n"); + form.append(new StringItem(null, Version.BOMBUS_SITE_URL+"\n", Item.HYPERLINK)); + // form.append(Version.getOs()); - form.append("\nCopyright (c) 2005-2007, Eugene Stahov (evgs),\n"); - form.append (new StringItem(null, Version.BOMBUS_SITE_URL -//#if !(MIDP1) - , Item.HYPERLINK -//#endif - )); + form.append("\nCopyright (c) 2005-2008, Eugene Stahov (evgs),\n"); + form.append(new StringItem(null, "http://bombus-im.org", Item.HYPERLINK)); // - StringBuffer memInfo=new StringBuffer("\n\n"); - memInfo.append(SR.MS_MEMORY); - memInfo.append("\n"); - memInfo.append(SR.MS_MEMORY_FREE); - //mem.append(Runtime.getRuntime().freeMemory()>>10); - //mem.append("\nFree="); - System.gc(); - memInfo.append(Runtime.getRuntime().freeMemory()>>10); - memInfo.append("\n"); - memInfo.append(SR.MS_MEMORY_TOTAL); - memInfo.append(Runtime.getRuntime().totalMemory()>>10); - form.append(memInfo.toString()); //#if ZLIB - form.append("\n\n"); + form.append("\n"); String conn_stats; try { conn_stats=StaticData.getInstance().roster.theStream.getStreamStats(); @@ -88,7 +75,17 @@ } form.append(conn_stats); //#endif - + + StringBuffer memInfo=new StringBuffer("\n Memory:\n"); + memInfo.append("Free="); + //mem.append(Runtime.getRuntime().freeMemory()>>10); + //mem.append("\nFree="); + System.gc(); + memInfo.append(Runtime.getRuntime().freeMemory()>>10); + memInfo.append("\nTotal="); + memInfo.append(Runtime.getRuntime().totalMemory()>>10); + form.append(memInfo.toString()); + form.setCommandListener(this); display.setCurrent(form); } Index: bombus-plus/export/trunk/src/Info/Version.java =================================================================== --- bombus-plus/export/trunk/src/Info/Version.java (revision 1288) +++ bombus-plus/export/trunk/src/Info/Version.java (working copy) @@ -35,15 +35,19 @@ * @author Evg_S */ public class Version { -//#if (!ZLIB) -//# public final static String version="$BOMBUSVERSION$"; +//#if (ReleaseJZLIB) || (ReleaseZH) +//# public final static String version="$BOMBUSVERSION$-Zlib"; // || $BUILDDATE$"; +//# //public final static String version="0._____M-Zlib || $BUILDDATE$"; +//# //public final static String version="$BOMBUSVERSION$-Zlib (Bombus+ and Opera Mini 3 combine, http://voffk.ax3.net/j2me/combines/ ); // || $BUILDDATE$"; +//#elif ReleaseZLITE +//# public final static String version="$BOMBUSVERSION$-Zlib (Lite)"; // || $BUILDDATE$"; //#else - public final static String version="$BOMBUSVERSION$-Zlib"; + public final static String version="$BOMBUSVERSION$"; // || $BUILDDATE$"; //#endif // this string will be patched by build.xml/post-preprocess - public final static String NAME="Bombus"; - public final static String BOMBUS_SITE_URL="http://bombus-im.org"; + public final static String NAME="Bombus+"; // + public final static String BOMBUS_SITE_URL="http://bombus.voffk.ax3.net"; // private static String platformName; @@ -85,7 +89,7 @@ if (device==null) device=System.getProperty("funlights.product"); if (device!=null) platformName="Motorola-"+device; String devicesoftware=System.getProperty("device.software.version"); - if (devicesoftware!=null) platformName=platformName+"//"+devicesoftware; + if (devicesoftware!=null) platformName=platformName+"/"+devicesoftware; } //#if (!MIDP1) Index: bombus-plus/export/trunk/src/Info/Upgrade.java =================================================================== --- bombus-plus/export/trunk/src/Info/Upgrade.java (revision 1288) +++ bombus-plus/export/trunk/src/Info/Upgrade.java (working copy) @@ -27,6 +27,7 @@ package Info; +import java.io.IOException; import java.io.InputStream; import java.util.Hashtable; import java.util.Vector; @@ -48,9 +49,13 @@ private Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 99); private Command cmdInstall=new Command(SR.MS_INSTALL, Command.ITEM, 1); + private Command cmdRefresh = new Command(SR.MS_REFRESH, Command.ITEM, 2); private final static String VERSION_URL=Version.BOMBUS_SITE_URL+"/version.php"; List list; Vector versions[]; + //Integer + private HttpConnection c; + private InputStream is; private Display display; private Displayable parentView; @@ -62,15 +67,17 @@ list=new List(SR.MS_AVAILABLE_VERSIONS, List.IMPLICIT); list.setCommandListener(this); list.addCommand(cmdBack); + list.addCommand(cmdRefresh); display.setCurrent(list); new Thread(this).start(); } public void run() { try { - String vUrl=Client.Config.getInstance().getStringProperty("Bombus-Upgrade", VERSION_URL); - HttpConnection c = (HttpConnection) Connector.open(vUrl); - InputStream is = c.openInputStream(); + /*String vUrl=Client.Config.getInstance().getStringProperty("Bombus-Upgrade", VERSION_URL); + HttpConnection c = (HttpConnection) Connector.open(vUrl);*/ // + c = (HttpConnection) Connector.open(VERSION_URL); + is = c.openInputStream(); versions=new util.StringLoader().stringLoader(is, 3); @@ -99,6 +106,24 @@ } catch (Exception e) { e.printStackTrace(); } } + + if(command == cmdRefresh)// Integer + { + list.deleteAll(); + try + { + is.close(); + c.close(); + } + catch(IOException e) + { + e.printStackTrace(); + } + finally + { + this.run(); + } + } } private void destroyView() { Index: bombus-plus/export/trunk/src/vcard/VCard.java =================================================================== --- bombus-plus/export/trunk/src/vcard/VCard.java (revision 1288) +++ bombus-plus/export/trunk/src/vcard/VCard.java (working copy) @@ -31,7 +31,7 @@ import com.alsutton.jabber.datablocks.Iq; import java.util.*; import java.io.*; -import javax.microedition.lcdui.Image; +//import javax.microedition.lcdui.Image; import util.StringLoader; import util.strconv; @@ -56,6 +56,8 @@ private boolean empty=true; + private String photoType=null; // + /** Creates a new instance of vCard */ public VCard() { if (vCardFields==null) fieldsLoader(); @@ -91,9 +93,12 @@ } try { - JabberDataBlock photoXML=vcard.getChildBlock("PHOTO").getChildBlock("BINVAL"); - photo=(byte[])photoXML.getChildBlocks().lastElement(); - } catch (Exception e) {}; + JabberDataBlock photoXML=vcard.getChildBlock("PHOTO"); + try { + photoType=photoXML.getChildBlock("TYPE").getText(); + } catch (Exception e) {} + photo=(byte[])photoXML.getChildBlock("BINVAL").getChildBlocks().lastElement(); + } catch (Exception e) {} } public JabberDataBlock constructVCard(){ @@ -118,11 +123,10 @@ } if (photo!=null) { - String mime=getPhotoMIMEType(); - if (mime!=null) { - JabberDataBlock ph=vcardTemp.addChild("PHOTO", null); - ph.addChild("BINVAL", strconv.toBase64(photo, -1)); - ph.addChild("TYPE", mime); + JabberDataBlock ph=vcardTemp.addChild("PHOTO", null); + ph.addChild("BINVAL", strconv.toBase64(photo, -1)); + if (photoType!=null) { + ph.addChild("TYPE", photoType); } } //System.out.println(vcard.toString()); @@ -131,7 +135,7 @@ public byte[] getPhoto() { return photo; } - public String getPhotoMIMEType() { + /*public String getPhotoMIMEType() { try { if (photo[0]==(byte)0xff && photo[1]==(byte)0xd8 && @@ -141,23 +145,23 @@ photo[9]==(byte)'F') return "image/jpeg"; - if (photo[0]==(byte)0x89 && + if (photo[0]==0x89 && photo[1]==(byte)'P' && photo[2]==(byte)'N' && photo[3]==(byte)'G') return "image/png"; - if (photo[0]==(byte)'G' && - photo[1]==(byte)'I' && - photo[2]==(byte)'F') + if (photo[1]==(byte)'G' && + photo[2]==(byte)'I' && + photo[3]==(byte)'F') return "image/gif"; - if (photo[0]==(byte)'B' && - photo[1]==(byte)'M') + if (photo[1]==(byte)'B' && + photo[2]==(byte)'M') return "image/x-ms-bmp"; } catch (Exception e) {} return null; - } + }*/ //moved to vCardForm public void setPhoto(byte[] photo) { this.photo=photo; @@ -198,6 +202,10 @@ vCardData.setElementAt(data, index); } + public void setPhotoType(String photoType) { + this.photoType=photoType; + } + public int getCount(){ return vCardFields.size(); } public String getJid() { return jid; } Index: bombus-plus/export/trunk/src/vcard/vCardForm.java =================================================================== --- bombus-plus/export/trunk/src/vcard/vCardForm.java (revision 1288) +++ bombus-plus/export/trunk/src/vcard/vCardForm.java (working copy) @@ -36,14 +36,19 @@ import java.io.OutputStream; //#endif -//#if (!MIDP1) import images.camera.*; -//#endif import java.util.*; import javax.microedition.lcdui.*; import locale.SR; +// +import ui.Time; +import util.strconv; +//import ui.controls.StringItemEx; +//import ui.controls.TextFieldEx; +// + /** * * @author EvgS @@ -53,10 +58,7 @@ //#if (FILE_IO) , BrowserListener //#endif - -//#if (!MIDP1) , CameraImageListener -//#endif { private Display display; @@ -65,9 +67,13 @@ protected Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 99); protected Command cmdPublish=new Command(SR.MS_PUBLISH, Command.OK /*Command.SCREEN*/, 1); protected Command cmdRefresh=new Command(SR.MS_REFRESH, Command.SCREEN, 2); - protected Command cmdPhoto=new Command(SR.MS_LOAD_PHOTO, Command.SCREEN,3); - protected Command cmdDelPhoto=new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN,4); - protected Command cmdCamera=new Command(SR.MS_CAMERA, Command.SCREEN,5); +//#if (FILE_IO) + protected Command cmdLoadPhoto=new Command(SR.MS_LOAD_PHOTO, Command.SCREEN,3); + protected Command cmdSavePhoto=new Command(SR.MS_SAVE_PHOTO, Command.SCREEN,4); +//#endif + protected Command cmdDelPhoto=new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN,5); + protected Command cmdCamera=new Command(SR.MS_CAMERA, Command.SCREEN,6); + protected Command cmdDelViewedPhoto = new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN, 7); private Form f; private Vector items=new Vector(); @@ -75,6 +81,15 @@ private byte[] photo; private int photoIndex; + // + private String photoType=null; + private int st=-1; +//#if FILE_IO + private int filePos; + private FileIO file; + private OutputStream os; +//#endif + // /** Creates a new instance of vCardForm */ public vCardForm(Display display, VCard vcard, boolean editable) { @@ -86,6 +101,17 @@ f=new Form(SR.MS_VCARD); f.append(vcard.getJid()); + // + if (vcard.isEmpty() && !editable) + f.append("\n[no vCard available]"); + else { + photoIndex=f.append("[]"); + + photo=vcard.getPhoto(); + setPhoto(); + } + // + for (int index=0; index"; } - item=new TextField(name, data, 500, TextField.ANY); + item=new TextField(name, data, 500, TextField.ANY);//TextFieldEx - for clipboard items.addElement(item); } else if (data!=null) { - item=new StringItem (name, data); + item=new StringItem (name, data);//StringItemEx - for clipboard } if (item!=null) { f.append(item); -//#if !(MIDP1) f.append(new Spacer(256, 3)); -//#else -//# f.append("\n"); -//#endif } } - if (vcard.isEmpty() && !editable) + // + f.append("\n[end of vCard]"); + /*if (vcard.isEmpty() && !editable) f.append("\n[no vCard available]"); else { photoIndex=f.append("[]"); @@ -123,7 +147,8 @@ f.append("\n\n[end of vCard]"); - } + }*/ //moved up + // f.addCommand(cmdCancel); @@ -131,15 +156,21 @@ if (editable) { f.addCommand(cmdPublish); //#if (FILE_IO) - f.addCommand(cmdPhoto); + f.addCommand(cmdLoadPhoto); //#endif -//#if !(MIDP1) String cameraAvailable=System.getProperty("supports.video.capture"); if (cameraAvailable!=null) if (cameraAvailable.startsWith("true")) f.addCommand(cmdCamera); -//#endif f.addCommand(cmdDelPhoto); } + // + if (!editable && photo!=null) { + f.addCommand(cmdDelViewedPhoto); +//#if (FILE_IO) + f.addCommand(cmdSavePhoto); +//#endif + } + // f.setCommandListener(this); display.setCurrent(f); } @@ -150,17 +181,25 @@ VCard.request(vcard.getJid(), vcard.getId().substring(5)); destroyView(); } - + // + if (c==cmdDelViewedPhoto) { + vcard.photo=null; + destroyView(); + } + // //#if (FILE_IO) - if (c==cmdPhoto) { + if (c==cmdLoadPhoto) { + st=1; new Browser(null, display, this, false); } + if (c==cmdSavePhoto) { + st=2; + new Browser(null, display, this, true); + } //#endif -//#if (!MIDP1) if (c==cmdCamera) new CameraImage(display, this); -//#endif if (c==cmdDelPhoto) { photo=null; @@ -170,7 +209,7 @@ if (c!=cmdPublish) return; vcard.setPhoto(photo); - + vcard.setPhotoType(getPhotoMIMEType()); for (int index=0; index0) { + if (st==1) { + try { + FileIO f=FileIO.createConnection(pathSelected); + InputStream is=f.openInputStream(); + byte[] b=new byte[(int)f.fileSize()]; + is.read(b); + is.close(); + f.close(); + photo=b; + vcard.setPhotoType(getPhotoMIMEType()); + //System.out.println(getPhotoMIMEType()); + setPhoto(); + } catch (Exception e) {e.printStackTrace();} + } + if (st==2 & photo!=null) { + //System.out.println(photoType+"->"+getFileType(photoType)); + String filename = strconv.replaceBadChars(getNickDate()); + file=FileIO.createConnection(pathSelected+filename+getFileType( getPhotoMIMEType() )); + try { + os=file.openOutputStream(); + writeFile(photo); + os.close(); + file.close(); + } catch (IOException ex) { + try { + file.close(); + } catch (IOException ex2) { } + } + } + } + } + + void writeFile(byte b[]){ try { - FileIO f=FileIO.createConnection(pathSelected); - InputStream is=f.openInputStream(); - byte[] b=new byte[(int)f.fileSize()]; - is.read(b); - is.close(); - f.close(); - photo=b; - setPhoto(); - } catch (Exception e) {e.printStackTrace();} + os.write(b); + filePos+=b.length; + } catch (IOException ex) { } } + + private String getNickDate() { + StringBuffer nickDate=new StringBuffer(); + nickDate.append("vCard_"); + if (vcard.getNickName()!=null) { + nickDate.append(vcard.getNickName()); + } else nickDate.append(vcard.getJid()); + nickDate.append("_"); + nickDate.append(Time.localDate()); + return nickDate.toString(); + } + + private String getFileType(String MIMEtype) { + if (MIMEtype!=null) { + if (MIMEtype=="image/jpeg") return ".jpg"; + if (MIMEtype=="image/png") return ".png"; + if (MIMEtype=="image/gif") return ".gif"; + if (MIMEtype=="image/x-ms-bmp") return ".bmp"; + } + return ".jpg"; + } //#endif -//#if (!MIDP1) public void cameraImageNotify(byte[] capturedPhoto) { photo=capturedPhoto; setPhoto(); } -//#endif private void setPhoto() { - Item photoItem=new StringItem(null, "[no photo available]"); if (photo!=null) { -//#if !(MIDP1) String size=String.valueOf(photo.length)+" bytes"; try { Image photoImg=Image.createImage(photo, 0, photo.length); photoItem=new ImageItem(size, photoImg, 0, null); } catch (Exception e) { photoItem=new StringItem(size, "[Unsupported format]"); } -//#endif } f.set(photoIndex, photoItem); } - -} + + public String getPhotoMIMEType() { + try { + if (photo[0]==(byte)0xff && + photo[1]==(byte)0xd8 && + (photo[6]==(byte)'J' || photo[6]==(byte)'E' || photo[6]==(byte)'e') && + (photo[7]==(byte)'F' || photo[7]==(byte)'x' || photo[7]==(byte)'X') && + (photo[8]==(byte)'I' || photo[8]==(byte)'i') && + (photo[9]==(byte)'F' || photo[9]==(byte)'f')) { + //System.out.println("image/jpeg"); + return "image/jpeg"; + } + + if (photo[0]==(byte)0x89 && + photo[1]==(byte)'P' && + photo[2]==(byte)'N' && + photo[3]==(byte)'G') { + //System.out.println("image/png"); + return "image/png"; + } + + if (photo[0]==(byte)'G' && + photo[1]==(byte)'I' && + photo[2]==(byte)'F') { + //System.out.println("image/gif"); + return "image/gif"; + } + + if (photo[0]==(byte)'B' && + photo[1]==(byte)'M') { + //System.out.println("image/x-ms-bmp"); + return "image/x-ms-bmp"; + } + + } catch (Exception e) {} + //System.out.println("unknown MIME type"); + return null; + } +} \ No newline at end of file Index: bombus-plus/export/trunk/src/locale/SR.java =================================================================== --- bombus-plus/export/trunk/src/locale/SR.java (revision 1288) +++ bombus-plus/export/trunk/src/locale/SR.java (working copy) @@ -28,20 +28,24 @@ package locale; +import java.util.Hashtable; + +//#if (!ReleaseZLITE) import Client.Config; -import java.util.Hashtable; -import javax.microedition.lcdui.Item; +//import javax.microedition.lcdui.Item; import util.StringLoader; +//#endif public class SR { - + public final static String MS_SLASHME = "/me"; +//#if (!ReleaseZLITE) public static String MS_JID = loadString( "Jid" ); public static String MS_PRIVACY_LISTS = loadString( "Privacy Lists" ); public static String MS_MESSAGE_FONT = loadString( "Message font" ); public static String MS_ROSTER_FONT = loadString( "Roster font" ); - public static String MS_PASTE_BODY = loadString( "Paste Body" ); + //public static String MS_PASTE_BODY = loadString( "Paste Body" ); <1> public static String MS_CONFIG_ROOM = loadString( "Configure Room" ); - public static String MS_PASTE_SUBJECT = loadString( "Paste Subject" ); + //public static String MS_PASTE_SUBJECT = loadString( "Paste Subject" ); <1> public static String MS_DISCO = loadString( "Service Discovery" ); public static String MS_USER_JID = loadString( "User JID" ); public static String MS_NEW_LIST = loadString( "New list" ); @@ -51,8 +55,11 @@ public static String MS_MODIFY = loadString( "Modify" ); public static String MS_UPDATE = loadString( "Update" ); public static String MS_ACCOUNT_NAME = loadString( "Account name" ); - public static String MS_GMT_OFFSET = loadString( "GMT offset" ); - public static String MS_TIME_SETTINGS = loadString( "Time settings (hours)" ); + public static String MS_GMT_OFFSET = loadString( "GMT offset, hours" ); // + + public static String MS_CLOCK_OFFSET = loadString( "Clock offset, hours" ); // + + //public static String MS_TIME_SETTINGS = loadString( "Time settings (hours)" ); public static String MS_CONNECTED = loadString( "Connected" ); public static String MS_CONNECT_TO = loadString( "Connect to " ); public static String MS_ALERT_PROFILE = loadString( "Alert Profile" ); @@ -74,7 +81,6 @@ public static String MS_ACCOUNTS = loadString( "Accounts" ); public static String MS_DELETE_LIST = loadString( "Delete list" ); public static String MS_ACCOUNT_= loadString( "Account >" ); - //public static String MS_SHOWOFFLINES = loadString( "Show Offlines" ); public static String MS_SELECT = loadString( "Select" ); public static String MS_SUBJECT = loadString( "Subject" ); public static String MS_GROUP_MENU = loadString( "Group menu" ); @@ -118,10 +124,9 @@ public static String MS_DELETE_ASK = loadString( "Delete contact?" ); public static String MS_SUBSCRIBE = loadString( "Authorize" ); public static String MS_NICKNAMES = loadString( "Nicknames" ); - //public static String MS_ENT_SETUP = loadString( "Entering setup" ); public static String MS_ADD_ARCHIVE = loadString( "to Archive" ); public static String MS_BACK = loadString( "Back" ); - public static String MS_HEAP_MONITOR = loadString( "heap monitor" ); + //public static String MS_HEAP_MONITOR = loadString( "heap monitor" ); public static String MS_MESSAGE = loadString( "Message" ); public static String MS_OTHER = loadString( "" ); public static String MS_HISTORY = loadString( "history -" ); @@ -141,14 +146,14 @@ public static String MS_STATUS = loadString( "Status" ); public static String MS_SMILES_TOGGLE = loadString( "Smiles" ); public static String MS_CONTACT = loadString( "Contact >" ); - public final static String MS_SLASHME = "/me"; + //public final static String MS_SLASHME = "/me"; //moved higher public static String MS_OFFLINE_CONTACTS = loadString( "offline contacts" ); public static String MS_TRANSPORT = loadString( "Transport" ); public static String MS_COMPOSING_EVENTS = loadString( "composing events" ); public static String MS_ADD_SMILE = loadString( "Add Smile" ); public static String MS_NICKNAME = loadString( "Nickname" ); public static String MS_REVOKE_VOICE = loadString( "Revoke Voice" ); - public static String MS_NOT_IN_LIST = loadString( "Not-in-list" ); + //public static String MS_NOT_IN_LIST = loadString( "Not-in-list" ); public static String MS_COMMANDS = loadString( "Commands" ); public static String MS_CHSIGN = loadString( "- (Sign)" ); public static String MS_SETDEFAULT = loadString( "Set default" ); @@ -168,7 +173,7 @@ public static String MS_CANCEL = loadString( "Cancel" ); public static String MS_CLOSE = loadString( "Close" ); public static String MS_ARCHIVE = loadString( "Archive" ); - public static String MS_FREE = loadString( "free " ); + //public static String MS_FREE = loadString( "free " ); public static String MS_CONFERENCE = loadString( "Conference" ); public static String MS_SOUND = loadString( "Sound" ); public static String MS_LOGIN_FAILED = loadString( "Login failed" ); @@ -193,7 +198,7 @@ public static String MS_ALL_STATUSES = loadString( "for all status types" ); public static String MS_PASTE_JID = loadString( "Paste Jid" ); public static String MS_GOTO_URL = loadString( "Goto URL" ); - public static String MS_CLOCK_OFFSET = loadString( "Clock offset" ); + public static String MS_YES = loadString( "Yes" ); public static String MS_FLASHBACKLIGHT = loadString( "flash backlight" ); public static String MS_SUSPEND = loadString( "Suspend" ); @@ -201,29 +206,26 @@ public static String MS_MY_VCARD = loadString( "My vCard" ); public static String MS_TRANSPORTS = loadString( "transports" ); public static String MS_NEW_ACCOUNT = loadString( "New Account" ); - public static String MS_SELF_CONTACT = loadString( "self-contact" ); + //public static String MS_SELF_CONTACT = loadString( "self-contact" ); public static String MS_VCARD = loadString( "vCard" ); public static String MS_SET_SUBJECT = loadString( "Set Subject" ); public static String MS_TOOLS = loadString( "Tools" ); //public static String MS_JABBER_TOOLS = loadString( "Jabber Tools" ); //replaced by "Tools" public static String MS_PORT = loadString( "Port" ); public static String MS_RESUME = loadString( "Resume Message" ); - //public static String MS_PROXY_ENABLE = loadString( "proxy CONNECT" ); - //public static String MS_PROXY_HOST = loadString( "Proxy name/IP" ); - //public static String MS_PROXY_PORT = loadString( "Proxy port" ); public static String MS_ARE_YOU_SURE_WANT_TO_DISCARD = loadString( "Are You sure want to discard " ); public static String MS_FROM_OWNER_TO = loadString( " from OWNER to " ); public static String MS_MODIFY_AFFILIATION = loadString( "Modify affiliation" ); //public static String MS_ADD_TO_ROSTER = loadString( "Add to roster" ); //not used in 1197 there are fs#464 ;-) (string don't deleted in locales) public static String MS_CLEAR=loadString( "Clear" ); public static String MS_SELLOGIN = loadString( "Connect" ); -//--toon +//toon public static String MS_UNAFFILIATE = loadString("Unaffiliate"); public static String MS_GRANT_MODERATOR = loadString("Grant Moderator"); public static String MS_REVOKE_MODERATOR = loadString("Revoke Moderator"); public static String MS_GRANT_ADMIN = loadString("Grant Admin"); public static String MS_GRANT_OWNERSHIP = loadString("Grant Ownership"); -//--toon +//toon public static String MS_VIZITORS_FORBIDDEN=loadString("Visitors are not allowed to send messages to all occupants"); public static String MS_IS_INVITING_YOU=loadString(" is inviting You to "); @@ -241,15 +243,15 @@ public static String MS_WAS_BANNED=loadString(" was banned "); public static String MS_WAS_KICKED=loadString(" was kicked "); public static String MS_HAS_BEEN_KICKED_BECAUSE_ROOM_BECAME_MEMBERS_ONLY=loadString(" has been kicked because room became members-only"); - public static String MS_HAS_LEFT_CHANNEL=loadString(" has left the channel"); - public static String MS_HAS_JOINED_THE_CHANNEL_AS=loadString(" has joined the channel as "); + public static String MS_HAS_LEFT_THE_ROOM=loadString(" has left the room"); + public static String MS_HAS_JOINED_THE_ROOM_AS=loadString(" has joined the room as "); public static String MS_AND=loadString(" and "); public static String MS_IS_NOW=loadString(" is now "); //2007-04-11 public static String MS_AUTOFOCUS = loadString( "autofocus" ); public static String MS_GRANT_MEMBERSHIP = loadString( "Grant Membership" ); - public static String MS_SURE_CLEAR = loadString( "Are You sure want to clear messagelist?" ); + public static String MS_SURE_CLEAR = loadString( "Delete the messages above the cursor?" ); public static String MS_TOKEN = loadString( "Google token request" ); @@ -270,7 +272,7 @@ public static String MS_DIRECT_PRESENCE = loadString( "Send status" ); public static String MS_CONFIRM_BAN = loadString( "Are you sure want to BAN this person?" ); - public static String MS_NO_REASON = loadString( "No reason" ); + //public static String MS_NO_REASON = loadString( "No reason" ); public static String MS_RECENT = loadString( "Recent" ); public static String MS_CAMERASHOT = loadString( "Shot" ); public static String MS_SELECT_FILE = loadString( "Select file" ); @@ -283,7 +285,7 @@ public static String MS_NEW_BOOKMARK = loadString( "New conference" ); public static String MS_ROOT = loadString( "Root" ); public static String MS_DECLINE = loadString( "Decline" ); - public static String MS_AUTH_NEW = loadString( "Authorize new contacts" ); + public static String MS_AUTH_NEW = loadString( "authorize new contacts" );// public static String MS_AUTH_AUTO = loadString( "[auto-subscribe]" ); public static String MS_KEEPALIVE = loadString( "Keep-Alive" ); public static String MS_HAS_BEEN_UNAFFILIATED_AND_KICKED_FROM_MEMBERS_ONLY_ROOM = loadString( " has been unaffiliated and kicked from members-only room" ); @@ -310,21 +312,17 @@ public static String MS_SHOW_HARDWARE = loadString( "shared platform info" ); public static String MS_DELIVERY = loadString( "delivery events" ); - public static String MS_NIL_DROP_MP = loadString( "drop all" ); - public static String MS_NIL_DROP_P = loadString( "receive messages" ); - public static String MS_NIL_ALLOW_ALL = loadString( "messages & presences" ); public static String MS_FONTSIZE_NORMAL = loadString( "normal" ); public static String MS_FONTSIZE_SMALL = loadString( "small" ); public static String MS_FONTSIZE_LARGE = loadString( "large" ); public static String MS_FILE_TRANSFERS = loadString( "File Transfers" ); - public static String MS_ALERT_PROFILE_AUTO = loadString( "Auto" ); + /*public static String MS_ALERT_PROFILE_AUTO = loadString( "Auto" ); public static String MS_ALERT_PROFILE_ALLSIGNALS = loadString( "All signals" ); public static String MS_ALERT_PROFILE_VIBRA = loadString( "Vibra" ); - //public static String MS_ALERT_PROFILE_SOUND = loadString( "Sound" ); + public static String MS_ALERT_PROFILE_SOUND = loadString( "Sound" ); public static String MS_ALERT_PROFILE_NOSIGNALS = loadString( "No signals" ); - public static String MS_IS_DEFAULT = loadString( " (default)" ); + public static String MS_ALERT_PROFILE_DEFAULT = loadString( " (default)" );*/ // -//2007-10-24 voffk public static String MS_MESSAGE_COLLAPSE_LIMIT = loadString ( "Message collapse limit" ); public static String MS_SUBSCRIPTION_REQUEST_FROM_USER = loadString ( "This user wants to subscribe to your presence" ); public static String MS_SUBSCRIPTION_RECEIVED = loadString ( "You are now authorized" ); @@ -340,35 +338,311 @@ public static String MS_SAVE_TO = loadString( "Save to" ); public static String MS_SENDER = loadString( "Sender:" ); public static String MS_FILE_SIZE = loadString( "size:" ); - - -//2007-11-04 - public static String MS_SUBSCR_AUTO=loadString("Automatic subscription"); - public static String MS_SUBSCR_ASK=loadString("Ask me"); - public static String MS_SUBSCR_DROP=loadString("Drop subscription"); - public static String MS_SUBSCR_REJECT=loadString("Deny subscription"); //TODO: correct according to RFC - -//2007-11-07 - public static String MS_SEARCH=loadString("Search"); - public static String MS_REGISTER=loadString("Register"); - +//// public static String MS_COLOR_THEME=loadString("Color theme"); - public static String MS_MEMORY=loadString( "Memory:" ); - public static String MS_MEMORY_FREE=loadString( "Free=" ); - public static String MS_MEMORY_TOTAL=loadString( "Total=" ); public static String MS_VERSIONS=loadString( "Versions" ); public static String MS_INSTALL=loadString( "Install" ); public static String MS_AVAILABLE_VERSIONS=loadString( "Available versions" ); + public static String MS_USER = loadString( "User" ); + public static String MS_NEW_ROOM_CREATED = loadString( "New room created" ); -//2008-01-16 - public static String MS_USER = loadString( "User" ); +// voffk +//#if NONSASL_ENABLE +//# public static String MS_SASL = loadString( "SASL login" ); +//#else + public static String MS_NO_COMPRESSION = loadString( "no compression" ); +//#endif + public static String MS_PASTE = loadString( "Paste" ); + public static String MS_PASTE_SPECIAL = loadString( "Paste + ~~~~~~~" ); + public static String MS_UNSUBSCRIBE_FROM_PRESENCES = loadString( "Unsubscribe from presences" ); + public static String MS_LAST_APPEARED_CONTACTS = loadString( "last appeared contacts" ); + public static String MS_SAVE_PHOTO = loadString( "Save photo to ..." ); + public static String MS_IDLE = loadString( "Idle" ); + public static String MS_TIME = loadString( "Time" ); + public static String MS_SOUND_VOLUME = loadString( "Sound volume" ); + public static String MS_MAX_RECONNECT = loadString( "Reconnects count" ); + public static String MS_MAKE_BACKUP = loadString( "Save to dir ..." ); + public static String MS_IMPORT_FROM_BACKUP = loadString( "Import from file" ); + + /*public static String MS_NIL_DROP_MP = loadString( "drop all" ); + public static String MS_NIL_DROP_P = loadString( "receive messages" ); + public static String MS_NIL_ALLOW_ALL = loadString( "messages & presences" ); */ // + +//#else +//# public final static String MS_JID = "Jid"; +//# public final static String MS_LOADING = ""; +//# public final static String MS_PRIVACY_LISTS = " "; +//# public final static String MS_MESSAGE_FONT = " "; +//# public final static String MS_ROSTER_FONT = " "; +//# public final static String MS_CONFIG_ROOM = " "; +//# public final static String MS_DISCO = " "; +//# public final static String MS_USER_JID = "JID "; +//# public final static String MS_NEW_LIST = " "; +//# public final static String MS_NOLOGIN = " ( )"; +//# public final static String MS_PRIVACY_RULE = " "; +//# public final static String MS_SSL = " SSL"; +//# public final static String MS_MODIFY = ""; +//# public final static String MS_UPDATE = ""; +//# public final static String MS_ACCOUNT_NAME = " "; +//# public final static String MS_GMT_OFFSET = " (GMTxx)"; +//# +//# public final static String MS_CLOCK_OFFSET = ". , "; +//# +//# public final static String MS_CONNECTED = " "; +//# public final static String MS_CONNECT_TO = " "; +//# public final static String MS_ALERT_PROFILE = ""; +//# public final static String MS_MOVE_UP = " "; +//# public final static String MS_OWNERS = ""; +//# public final static String MS_OK = ""; +//# public final static String MS_APP_MINIMIZE = ""; +//# public final static String MS_ROOM = ""; +//# public final static String MS_MESSAGES = ""; +//# public final static String MS_REFRESH = ""; +//# public final static String MS_RESOLVE_NICKNAMES = " "; +//# public final static String MS_PRIVACY_ACTION = ""; +//# public final static String MS_BAN = " (ban)"; +//# public final static String MS_LEAVE_ROOM = " "; +//# public final static String MS_PASSWORD = ""; +//# public final static String MS_ITEM_ACTIONS = " >"; +//# public final static String MS_ACTIVATE = ""; +//# public final static String MS_AFFILIATION = ""; +//# public final static String MS_ACCOUNTS = ""; +//# public final static String MS_DELETE_LIST = " "; +//# public final static String MS_ACCOUNT_ = " >"; +//# public final static String MS_SELECT = ""; +//# public final static String MS_SUBJECT = ""; +//# public final static String MS_GROUP_MENU = " "; +//# public final static String MS_APP_QUIT = ""; +//# public final static String MS_ROSTERADD = " "; +//# public final static String MS_EDIT_LIST = " "; +//# public final static String MS_REGISTERING = ""; +//# public final static String MS_DONE = ""; +//# public final static String MS_ERROR_ = ": "; +//# public final static String MS_BROWSE = ""; +//# public final static String MS_SAVE_LIST = " "; +//# public final static String MS_KEEPALIVE_PERIOD = " Keep-Alive"; +//# public final static String MS_NEWGROUP = "< >"; +//# public final static String MS_SEND = ""; +//# public final static String MS_PRIORITY = ""; +//# public final static String MS_FAILED = " "; +//# public final static String MS_SET_PRIORITY = " "; +//# public final static String MS_DELETE_RULE = " "; +//# public final static String MS_IGNORE_LIST = "Ignore-List"; +//# public final static String MS_ROSTER_REQUEST = " "; +//# public final static String MS_PRIVACY_TYPE = ""; +//# public final static String MS_NAME = ""; +//# public final static String MS_USERNAME = " "; +//# public final static String MS_FULLSCREEN = ""; +//# public final static String MS_ALL_PRIORITIES = " "; +//# public final static String MS_ADD_BOOKMARK = ". "; +//# public final static String MS_CONFERENCES_ONLY = " "; +//# public final static String MS_CLIENT_INFO = " "; +//# public final static String MS_DISCARD = " "; +//# public final static String MS_SEARCH_RESULTS = " "; +//# public final static String MS_GENERAL = "General"; +//# public final static String MS_MEMBERS = ""; +//# public final static String MS_ADD_CONTACT = " "; +//# public final static String MS_SUBSCRIPTION = ""; +//# public final static String MS_STATUS_MENU = " >"; +//# public final static String MS_JOIN = ""; +//# public final static String MS_STARTUP_ACTIONS = " "; +//# public final static String MS_SERVER = ""; +//# public final static String MS_ADMINS = ""; +//# public final static String MS_MK_ILIST = " Ignore-List"; +//# public final static String MS_OPTIONS = ""; +//# public final static String MS_DELETE = ""; +//# public final static String MS_DELETE_ASK = " ?"; +//# public final static String MS_SUBSCRIBE = ""; +//# public final static String MS_NICKNAMES = " "; +//# public final static String MS_ENT_SETUP = " "; +//# public final static String MS_ADD_ARCHIVE = " "; +//# public final static String MS_BACK = ""; +//# public final static String MS_MESSAGE = ""; +//# public final static String MS_OTHER = "<>"; +//# public final static String MS_HISTORY = " -"; +//# public final static String MS_APPEND = ""; +//# public final static String MS_ACTIVE_CONTACTS = ". "; +//# public final static String MS_SELECT_NICKNAME = " "; +//# public final static String MS_GROUP = ""; +//# public final static String MS_JOIN_CONFERENCE = " "; +//# public final static String MS_NO = ""; +//# public final static String MS_REENTER = " "; +//# public final static String MS_NEW_MESSAGE = " "; +//# public final static String MS_ADD = ""; +//# public final static String MS_LOGON = ""; +//# public final static String MS_LOGINPGS = " "; +//# public final static String MS_STANZAS = "Stanzas"; +//# public final static String MS_AT_HOST = ""; +//# public final static String MS_AUTO_CONFERENCES = " "; +//# public final static String MS_STATUS = ""; +//# public final static String MS_SMILES_TOGGLE = "/ "; +//# public final static String MS_CONTACT = " >"; +//# public final static String MS_ORDER = ""; +//# public final static String MS_OFFLINE_CONTACTS = " "; +//# public final static String MS_TRANSPORT = ""; +//# public final static String MS_COMPOSING_EVENTS = ". "; +//# public final static String MS_ADD_SMILE = ""; +//# public final static String MS_NICKNAME = ""; +//# public final static String MS_REVOKE_VOICE = " "; +//# public final static String MS_COMMANDS = ""; +//# public final static String MS_CHSIGN = "- ()"; +//# public final static String MS_SETDEFAULT = ". "; +//# public final static String MS_BANNED = ""; +//# public final static String MS_SET_AFFILIATION = " "; +//# public final static String MS_HIDE_OFFLINES = " "; +//# public final static String MS_REGISTER_ACCOUNT = " "; +//# public final static String MS_AUTOLOGIN = ""; +//# public final static String MS_LOGOFF = ""; +//# public final static String MS_PUBLISH = ""; +//# public final static String MS_SUBSCR_REMOVE = " "; +//# public final static String MS_SET = ""; +//# public final static String MS_APPLICATION = ""; +//# public final static String MS_BOOKMARKS = ""; +//# public final static String MS_TEST_SOUND = " "; +//# public final static String MS_STARTUP = ""; +//# public final static String MS_EDIT_RULE = " "; +//# public final static String MS_CANCEL = ""; +//# public final static String MS_CLOSE = ""; +//# public final static String MS_ARCHIVE = ""; +//# public final static String MS_FREE = " "; +//# public final static String MS_CONFERENCE = ""; +//# public final static String MS_SOUND = ""; +//# public final static String MS_LOGIN_FAILED = " "; +//# public final static String MS_DISCOVER = ""; +//# public final static String MS_NEW_JID = " Jid"; +//# public final static String MS_PLAIN_PWD = " . "; +//# public final static String MS_PASTE_NICKNAME = " "; +//# public final static String MS_KICK = " (kick)"; +//# public final static String MS_CLEAR_LIST = " "; +//# public final static String MS_GRANT_VOICE = " "; +//# public final static String MS_MOVE_DOWN = " "; +//# public final static String MS_QUOTE = ""; +//# public final static String MS_ROSTER_ELEMENTS = " "; +//# public final static String MS_ENABLE_POPUP = " "; +//# public final static String MS_SMILES = ""; +//# public final static String MS_ABOUT = " "; +//# public final static String MS_RESOURCE = ""; +//# public final static String MS_DISCONNECTED = " "; +//# public final static String MS_EDIT = ""; +//# public final static String MS_HOST_IP = " /IP ()"; +//# public final static String MS_ADD_RULE = " "; +//# public final static String MS_ALL_STATUSES = " "; +//# public final static String MS_PASTE_JID = " Jid"; +//# public final static String MS_GOTO_URL = " URL"; +//# public final static String MS_CLOCK = " -"; +//# public final static String MS_LOGIN = " "; +//# +//# public final static String MS_YES = ""; +//# public final static String MS_FLASHBACKLIGHT = " "; +//# public final static String MS_SUSPEND = ""; +//# public final static String MS_ALERT_PROFILE_CMD = " >"; +//# public final static String MS_MY_VCARD = " vCard"; +//# public final static String MS_NEW_ACCOUNT = " "; +//# public final static String MS_VCARD = "vCard"; +//# public final static String MS_SET_SUBJECT = " "; +//# public final static String MS_TOOLS = ""; +//# public final static String MS_PORT = ""; +//# public final static String MS_RESUME = ""; +//# public final static String MS_PROXY_ENABLE = "proxy CONNECT"; +//# public final static String MS_PROXY_HOST = " -/IP"; +//# public final static String PROXY_PORT = " -"; +//# public final static String MS_ARE_YOU_SURE_WANT_TO_DISCARD = " "; +//# public final static String MS_FROM_OWNER_TO = " OWNER "; +//# public final static String MS_MODIFY_AFFILIATION = " "; +//# public final static String MS_ADD_TO_ROSTER = " "; +//# public final static String MS_CLEAR = ""; +//# public final static String MS_SELLOGIN = ""; +//# public final static String MS_UNAFFILIATE = " "; +//# public final static String MS_GRANT_MODERATOR = " "; +//# public final static String MS_REVOKE_MODERATOR = " "; +//# public final static String MS_GRANT_ADMIN = " "; +//# public final static String MS_GRANT_OWNERSHIP = " "; +//# public final static String MS_VIZITORS_FORBIDDEN = " "; +//# public final static String MS_IS_INVITING_YOU = " "; +//# public final static String MS_ASK_SUBSCRIPTION = " "; +//# public final static String MS_GRANT_SUBSCRIPTION = " "; +//# public final static String MS_INVITE = " "; +//# public final static String MS_REASON = ""; +//# public final static String MS_YOU_HAVE_BEEN_INVITED = " "; +//# public final static String MS_DISCO_ROOM = ""; +//# public final static String MS_CAPS_STATE = ""; +//# public final static String MS_STORE_PRESENCE = " "; +//# public final static String MS_IS_NOW_KNOWN_AS = " "; +//# public final static String MS_WAS_BANNED = " "; +//# public final static String MS_WAS_KICKED = " "; +//# public final static String MS_HAS_BEEN_KICKED_BECAUSE_ROOM_BECAME_MEMBERS_ONLY = " , .. "; +//# public final static String MS_HAS_LEFT_CHANNEL = " "; +//# public final static String MS_HAS_JOINED_THE_CHANNEL_AS = " "; +//# public final static String MS_AND = " "; +//# public final static String MS_IS_NOW = " "; +//# public final static String MS_AUTOFOCUS = ""; +//# public final static String MS_GRANT_MEMBERSHIP = " "; +//# public final static String MS_SURE_CLEAR = " ?"; +//# public final static String MS_TOKEN = " Google"; +//# public final static String MS_SASL = "SASL-"; +//# public final static String MS_FEATURES = ""; +//# public final static String MS_SHOWPWD = " "; +//# public final static String MS_NO_VERSION_AVAILABLE = " "; +//# public final static String MS_MSG_LIMIT = " "; +//# public final static String MS_OPENING_STREAM = " "; +//# public final static String MS_ZLIB = " "; +//# public final static String MS_AUTH = ""; +//# public final static String MS_RESOURCE_BINDING = " "; +//# public final static String MS_SESSION = " "; +//# public final static String MS_TEXTWRAP = " "; +//# public final static String MS_TEXTWRAP_CHARACTER = " "; +//# public final static String MS_TEXTWRAP_WORD = " "; +//# public final static String MS_INFO = ""; +//# public final static String MS_REPLY = ""; +//# public final static String MS_DIRECT_PRESENCE = " "; +//# public final static String MS_CONFIRM_BAN = " , ?"; +//# public final static String MS_RECENT = " "; +//# public final static String MS_CAMERASHOT = ""; +//# public final static String MS_SELECT_FILE = " "; +//# public final static String MS_LOAD_PHOTO = " "; +//# public final static String MS_CLEAR_PHOTO = " "; +//# public final static String MS_CAMERA = ""; +//# public final static String MS_HIDE_FINISHED = " "; +//# public final static String MS_TRANSFERS = " "; +//# public final static String MS_SURE_DELETE = " ?"; +//# public final static String MS_NEW_BOOKMARK = " "; +//# public final static String MS_ROOT = " "; +//# public final static String MS_DECLINE = ""; +//# public final static String MS_AUTH_NEW = ". "; +//# public final static String MS_AUTH_AUTO = "[]"; +//# public final static String MS_KEEPALIVE = " Keep-Alive"; +//# public final static String MS_HAS_BEEN_UNAFFILIATED_AND_KICKED_FROM_MEMBERS_ONLY_ROOM = " , .. "; +//# public final static String MS_AWAY_PERIOD = " ()"; +//# public final static String MS_AWAY_TYPE = " "; +//# public final static String MS_AWAY_OFF = ""; +//# public final static String MS_AWAY_LOCK = " / "; +//# public final static String MS_AWAY_IDLE = ""; +//# public final static String MS_ADD_AUTOJ = ". "; +//# +//# public final static String MS_DO_AUTOJOIN = " "; //temporary +//# public final static String MS_SHOW_HARDWARE = " "; +//# public final static String MS_DELIVERY = " "; +//# public final static String MS_FONTSIZE_NORMAL = ""; +//# public final static String MS_FONTSIZE_SMALL = " "; +//# public final static String MS_FONTSIZE_LARGE = ""; +//# public final static String MS_FILE_TRANSFERS = " "; +//# public final static String MS_ALERT_PROFILE_AUTO = ""; +//# public final static String MS_ALERT_PROFILE_ALLSIGNALS = " "; +//# public final static String MS_ALERT_PROFILE_VIBRA = ""; +//# public final static String MS_ALERT_PROFILE_SOUND = ""; +//# public final static String MS_ALERT_PROFILE_NOSIGNALS = " "; +//# public final static String MS_ALERT_PROFILE_DEFAULT = " ( )"; +//# +//# public final static String MS_PASTE = ""; +//# public final static String MS_PASTE_SPECIAL = " c ~~~~~~~"; +//# public final static String MS_MESSAGE_COLLAPSE_LIMIT = " "; +//#endif + + +//#if (!ReleaseZLITE) public static String MS_XMLLANG; public static String MS_IFACELANG; - public static String MS_NO_COMPRESSION = loadString( "No compression" ); - - public static String MS_NEW_ROOM_CREATED = loadString( "New room created" ); - private SR() { } private static Hashtable presences; @@ -403,7 +677,7 @@ System.err.print(key); System.err.println('>'); } - } + } //#endif return (value==null)?key:value; } @@ -415,5 +689,28 @@ public static void loaded() { lang=null; } - +//#else +//# private SR() { } +//# +//# public final static String MS_XMLLANG = "ru"; +//# public final static String MS_IFACELANG = "ru"; +//# +//# private static Hashtable presences=new Hashtable(); +//# { +//# presences.put("online", ""); +//# presences.put("chat", " "); +//# presences.put("away", ""); +//# presences.put("xa", ""); +//# presences.put("invisible", ""); +//# presences.put("dnd", " "); +//# presences.put("unavailable", ""); +//# } +//# +//# public static String getPresence(String presenceName) { +//# return (String) presences.get(presenceName); +//# } +//# +//# public static void loaded() { +//# } +//#endif } Index: bombus-plus/export/trunk/src/images/RosterIcons.java =================================================================== --- bombus-plus/export/trunk/src/images/RosterIcons.java (revision 1288) +++ bombus-plus/export/trunk/src/images/RosterIcons.java (working copy) @@ -138,5 +138,11 @@ public static final int ICON_KEYBLOCK_INDEX = 0x17; public static Integer iconHasVcard=new Integer(ICON_SEARCH_INDEX); + + public static final int ICON_GCCOLLAPSED_INDEX = 0x42; // + + public static final int ICON_VIEWING_INDEX = 0x57; // + + public static final int ICON_APPEARING_INDEX = 0x36; // } Index: bombus-plus/export/trunk/src/Conference/MucContact.java =================================================================== --- bombus-plus/export/trunk/src/Conference/MucContact.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/MucContact.java (working copy) @@ -138,7 +138,7 @@ break; case ROLE_VISITOR: transport=RosterIcons.getInstance().getTransportIndex("muc#vis"); - key0=3; + key0=2; // break; default: transport=0; @@ -207,7 +207,15 @@ break; default: - b.append(SR.MS_HAS_LEFT_CHANNEL); + // + //b.append(SR.MS_HAS_LEFT_CHANNEL); + b.append(SR.MS_HAS_LEFT_THE_ROOM); + + if (realJid!=null) { + b.append(" - "); + appendL(b,realJid); + } + // if (statusText.length()>0) { b.append(" ("); @@ -227,7 +235,7 @@ appendL(b, realJid); b.append(')'); } - b.append(SR.MS_HAS_JOINED_THE_CHANNEL_AS); + b.append(SR.MS_HAS_JOINED_THE_ROOM_AS); b.append(role); if (!affiliation.equals("none")) { b.append(SR.MS_AND); Index: bombus-plus/export/trunk/src/Conference/InviteForm.java =================================================================== --- bombus-plus/export/trunk/src/Conference/InviteForm.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/InviteForm.java (working copy) @@ -42,6 +42,7 @@ import javax.microedition.lcdui.TextField; import locale.SR; import ui.ConstMIDP; +import ui.controls.TextFieldCombo; // /** * @@ -67,7 +68,7 @@ parentView=display.getCurrent(); form=new Form(SR.MS_INVITE); - reason=new TextField(SR.MS_REASON, null, 200, TextField.ANY); + reason=new TextFieldCombo(SR.MS_REASON, "", 200, TextField.ANY, "muc-invite-reasons", display); // conferenceList=new ChoiceGroup (SR.MS_CONFERENCE, ConstMIDP.CHOICE_POPUP); for (Enumeration c=StaticData.getInstance().roster.getHContacts().elements(); c.hasMoreElements(); ) { Index: bombus-plus/export/trunk/src/Conference/ConferenceGroup.java =================================================================== --- bombus-plus/export/trunk/src/Conference/ConferenceGroup.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/ConferenceGroup.java (working copy) @@ -45,6 +45,7 @@ super(name); this.label=label; imageExpandedIndex=RosterIcons.ICON_GCJOIN_INDEX; + imageCollapsedIndex=RosterIcons.ICON_GCCOLLAPSED_INDEX; // this.type=Groups.TYPE_MUC; } Index: bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java =================================================================== --- bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java (working copy) @@ -39,7 +39,7 @@ import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Form; //#if (!MIDP1) -import javax.microedition.lcdui.Spacer; +//import javax.microedition.lcdui.Spacer; //#endif import javax.microedition.lcdui.StringItem; import javax.microedition.lcdui.TextField; @@ -68,7 +68,7 @@ private MucContact victim; private Command cmdOk; - private Command cmdNoReason=new Command(SR.MS_NO_REASON, Command.SCREEN, 2); + //private Command cmdNoReason=new Command(SR.MS_NO_REASON, Command.SCREEN, 2); private Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 99); private int action; @@ -117,7 +117,7 @@ f.append(new StringItem(SR.MS_USER, user.toString())); //#if (!MIDP1) - f.append(new Spacer(256, 33)); + //f.append(new Spacer(256, 33)); //#endif reason=new TextFieldCombo(SR.MS_REASON, "", 256, TextField.ANY, "reason", display); @@ -125,7 +125,7 @@ cmdOk=new Command( okName, Command.SCREEN, 1); f.addCommand(cmdOk); - f.addCommand(cmdNoReason); + //f.addCommand(cmdNoReason); f.addCommand(cmdCancel); f.setCommandListener(this); @@ -133,10 +133,10 @@ } public void commandAction(Command command, Displayable displayable) { - if (command==cmdNoReason) { + /*if (command==cmdNoReason) { reason.setString(""); return; - } + }*/ if (command==cmdOk) setMucMod(); display.setCurrent(StaticData.getInstance().roster); Index: bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java =================================================================== --- bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java (working copy) @@ -74,11 +74,11 @@ this.room=room; //fix for old muc - switch (affiliationIndex) { + /*switch (affiliationIndex) { case AffiliationItem.AFFILIATION_OWNER: case AffiliationItem.AFFILIATION_ADMIN: if (!Config.getInstance().muc119) namespace="http://jabber.org/protocol/muc#owner"; - } + }*/ // this.id=AffiliationItem.getAffiliationName(affiliationIndex); Index: bombus-plus/export/trunk/src/Conference/ConferenceForm.java =================================================================== --- bombus-plus/export/trunk/src/Conference/ConferenceForm.java (revision 1288) +++ bombus-plus/export/trunk/src/Conference/ConferenceForm.java (working copy) @@ -58,8 +58,8 @@ StaticData sd=StaticData.getInstance(); /** Creates a new instance of GroupChatForm */ - public ConferenceForm(Display display) { - String room=Config.getInstance().defGcRoom; + public ConferenceForm(Display display) { // + /*String room=Config.getInstance().defGcRoom; String server=null; // trying to split string like room@server int roomE=room.indexOf('@'); @@ -69,7 +69,8 @@ } // default server if (server==null) server="conference."+sd.account.getServer(); - createForm(display, room, server, null, null); + createForm(display, room, server, null, null); */ + createForm(display, "bombus-plus", "conference.jabbus.org", null, null); } /** Creates a new instance of GroupChatForm */ @@ -100,7 +101,7 @@ Form formJoin=new Form(SR.MS_JOIN_CONFERENCE); - roomField=new TextField(SR.MS_ROOM, room, 64, TextField.ANY); + roomField=new TextFieldCombo(SR.MS_ROOM, room, 64, TextField.ANY, "muc-room", display); // TextFieldCombo.setLowerCaseLatin(roomField); formJoin.append(roomField); @@ -114,7 +115,7 @@ msgLimitField=new NumberField(SR.MS_MSG_LIMIT, 20, 0, 100); formJoin.append(msgLimitField); - + passField=new TextField(SR.MS_PASSWORD, password, 32, TextField.ANY | ConstMIDP.TEXTFIELD_SENSITIVE ); formJoin.append(passField); @@ -181,7 +182,7 @@ JabberDataBlock history=x.addChild("history", null); history.setAttribute("maxstanzas", String.valueOf(maxStanzas)); - history.setAttribute("maxchars","32768"); + history.setAttribute("maxchars",/*"32768"*/ "10000"); // try { long last=grp.getConference().lastMessageTime; long delay= ( grp.conferenceJoinTime - last ) /1000 ; Index: bombus-plus/export/trunk/src/Messages/MessageUrl.java =================================================================== --- bombus-plus/export/trunk/src/Messages/MessageUrl.java (revision 1288) +++ bombus-plus/export/trunk/src/Messages/MessageUrl.java (working copy) @@ -32,6 +32,12 @@ import javax.microedition.lcdui.Display; import midlet.Bombus; import ui.Menu; +// /** * @@ -54,11 +60,11 @@ public void eventOk() { String url=(String)urlList.elementAt(cursor); -//#if !(MIDP1) try { Bombus.getInstance().platformRequest(url); } catch (Exception e) { e.printStackTrace(); } -//#endif - destroyView(); + //destroyView(); + /*Msg urlMsg=new Msg(Msg.MESSAGE_TYPE_IN, "xxx", null, url); + MessageArchive.store(urlMsg);*/ // } } Index: bombus-plus/export/trunk/src/io/file/browse/Browser.java =================================================================== --- bombus-plus/export/trunk/src/io/file/browse/Browser.java (revision 1288) +++ bombus-plus/export/trunk/src/io/file/browse/Browser.java (working copy) @@ -65,7 +65,7 @@ Command cmdInfo=new Command(SR.MS_INFO, Command.SCREEN, 3); Command cmdRoot=new Command(SR.MS_ROOT, Command.SCREEN, 4); Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 98); - Command cmdCancel=new Command(SR.MS_CANCEL, Command.EXIT, 99); + Command cmdCancel=new Command(SR.MS_CANCEL, Command.SCREEN, 99); private String path; private BrowserListener browserListener; Index: bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java =================================================================== --- bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java (revision 1288) +++ bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java (working copy) @@ -57,7 +57,7 @@ TextField path; Command cmdOk=new Command(SR.MS_OK, Command.OK, 1); - Command cmdDecline=new Command(SR.MS_CANCEL, Command.CANCEL, 90); + Command cmdDecline=new Command(SR.MS_CANCEL, Command.SCREEN, 90); Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 99); Command cmdPath=new Command(SR.MS_PATH, Command.SCREEN, 2); /** Creates a new instance of TransferAcceptFile */ Index: bombus-plus/export/trunk/src/io/Utf8IOStream.java =================================================================== --- bombus-plus/export/trunk/src/io/Utf8IOStream.java (revision 1288) +++ bombus-plus/export/trunk/src/io/Utf8IOStream.java (working copy) @@ -62,7 +62,7 @@ //#if (ZLIB) public void setStreamCompression(){ inpStream=new ZInputStream(inpStream); - outStream=new ZOutputStream(outStream, JZlib.Z_DEFAULT_COMPRESSION); + outStream=new ZOutputStream(outStream, JZlib.Z_BEST_COMPRESSION); ((ZOutputStream)outStream).setFlushMode(JZlib.Z_SYNC_FLUSH); } //#endif @@ -127,7 +127,7 @@ //#endif } //#if (XML_STREAM_DEBUG) -//# System.out.println(">> "+data); +//# System.out.println("OUT: "+data); //#endif } @@ -149,10 +149,6 @@ //#endif while (avail==0) { -//#if !ZLIB -//# //trying to fix phillips 9@9 -//# if (!Config.getInstance().istreamWaiting) break; -//#endif try { Thread.sleep(100); } catch (Exception e) {}; avail=inpStream.available(); } @@ -160,13 +156,13 @@ //#if !(XML_STREAM_DEBUG) if (avail<2) return inpStream.read() &0xff; //#else -//# if (avail<2) { -//# System.out.println(" single-byte"); -//# int ch=inpStream.read(); -//# System.out.println("<< "+(char)ch); -//# return ch; -//# } -//# System.out.println(" prebuffering "+avail); +//# if (avail<2) { +//# System.out.println(" single-byte"); +//# int ch=inpStream.read(); +//# System.out.println("IN: "+(char)ch); // +//# return ch; +//# } +//# //System.out.println(" prebuffering "+avail); // //#endif @@ -175,7 +171,7 @@ pbyte=1; //#if (XML_STREAM_DEBUG) -//# System.out.println("<< "+new String(cbuf, 0, length)); +//# System.out.print("IN: "+new String(cbuf, 0, length)); // //#endif return cbuf[0]; } @@ -243,17 +239,16 @@ s.append(packed); s.append(read?">>>":"<<<"); s.append(unpacked); String ratio=Long.toString((10*unpacked)/packed); int dotpos=ratio.length()-1; - - /* + + //compression ratio s.append(" ratio="); s.append( (dotpos==0)? "0":ratio.substring(0, dotpos)); s.append('.'); s.append(ratio.substring(dotpos)); s.append('x'); - */ } - - public String getStreamStats() { + + public String getStreamStats() { // StringBuffer stats=new StringBuffer(); int sent=this.bytesSent; int recv=this.bytesRecv; @@ -262,21 +257,55 @@ recv+=z.getTotalIn()-z.getTotalOut(); ZOutputStream zo = (ZOutputStream) outStream; sent+=zo.getTotalOut()-zo.getTotalIn(); - stats.append("ZLib:\nin="); appendZlibStats(stats, z.getTotalIn(), z.getTotalOut(), true); + stats.append(" ZLib:\nin="); appendZlibStats(stats, z.getTotalIn(), z.getTotalOut(), true); stats.append("\nout="); appendZlibStats(stats, zo.getTotalOut(), zo.getTotalIn(), false); } - stats.append("\nStream:\nin="); stats.append(recv); + stats.append("\n Stream:\nin="); stats.append(recv); stats.append("\nout="); stats.append(sent); - stats.append("\n\nIP="); + stats.append("\n Local IP="); try { stats.append(((SocketConnection)connection).getLocalAddress()); stats.append(":"); stats.append(((SocketConnection)connection).getLocalPort()); } catch (Exception ex) { stats.append("unknown"); - } + } + stats.append("\n Remote IP="); + try { + stats.append(((SocketConnection)connection).getAddress()); + stats.append(":"); + stats.append(((SocketConnection)connection).getPort()); + } catch (Exception ex) { + stats.append("unknown"); + } + return stats.toString(); } + + //#if TRAFFIC +//# public int getTrafficBytes() {// +//# int sent=this.bytesSent; +//# int recv=this.bytesRecv; +//# if (inpStream instanceof ZInputStream) { +//# ZOutputStream zo = (ZOutputStream) outStream; +//# ZInputStream z = (ZInputStream) inpStream; +//# sent+=zo.getTotalOut()-zo.getTotalIn(); +//# recv+=z.getTotalIn()-z.getTotalOut(); +//# return recv+sent; +//# } else return 0; +//# /*BombusMod: +//# try { +//# if (inpStream instanceof ZInputStream) { +//# ZOutputStream zo = (ZOutputStream) outStream; +//# ZInputStream z = (ZInputStream) inpStream; +//# return ((int)zo.getTotalOut()+(int)z.getTotalIn()); +//# } +//# return (this.bytesSent+this.bytesRecv); +//# } catch (Exception e) { } +//# return 0;*/ +//# } + //#endif + //#endif } Index: bombus-plus/export/trunk/src/login/SASLAuth.java =================================================================== --- bombus-plus/export/trunk/src/login/SASLAuth.java (revision 1288) +++ bombus-plus/export/trunk/src/login/SASLAuth.java (working copy) @@ -74,7 +74,11 @@ if (data.getTagName().equals("stream:features")) { //#if ZLIB JabberDataBlock compr=data.getChildBlock("compression"); - if (compr!=null && account.useCompression()) { + if (compr!=null + //#if !NONSASL_ENABLE + && account.useCompression() + //#endif + ) { if (compr.getChildBlockByText("zlib")!=null) { // negotiating compression JabberDataBlock askCompr=new JabberDataBlock("compress", null, null); @@ -169,7 +173,7 @@ if (nonceIndex>=0) { nonceIndex+=7; String nonce=challenge.substring(nonceIndex, challenge.indexOf('\"', nonceIndex)); - String cnonce=Config.getInstance().getStringProperty("Bombus-CNonce", "123456789abcd"); + String cnonce=Config.getInstance().getStringProperty("Bombus-CNonce", "123456789abcd"); resp.setText(responseMd5Digest( strconv.unicodeToUTF(account.getUserName()), Index: bombus-plus/export/trunk/src/_icon.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bombus-plus/export/trunk/src/ui/Colors.java =================================================================== --- bombus-plus/export/trunk/src/ui/Colors.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/Colors.java (working copy) @@ -195,8 +195,8 @@ PGS_BORDER = loadColor("PGS_BORDER", 0x808080); PGS_BGND = loadColor("PGS_BGND", 0x000000); - HEAP_TOTAL = loadColor("HEAP_TOTAL", 0xffffff); - HEAP_FREE = loadColor("HEAP_FREE", 0x00007f); + HEAP_TOTAL = loadColor("HEAP_TOTAL", /*0xffffff 0x000000*/0x0033ff); + HEAP_FREE = loadColor("HEAP_FREE", /*0x00007f 0xFF1493*/0xee0000); CURSOR_BGND = loadColor("CURSOR_BGND", 0xC8D7E6); CURSOR_OUTLINE = loadColor("CURSOR_OUTLINE", 0x000066); @@ -214,13 +214,13 @@ String themeFile=Config.getInstance().themeFileName(); if (themeFile==null) theme=new Hashtable(); else theme=new StringLoader().hashtableLoader(themeFile); - System.out.println("Loading color theme "+themeFile); + // System.out.println("Loading color theme "+themeFile); } try { String value=(String)theme.get(key); return Integer.parseInt(value.substring(2),16); } catch (Exception e) { - System.out.println("Can't find:"+key); //colors debug + // System.out.println("Can't find:"+key); //colors debug return defaultColor; } } Index: bombus-plus/export/trunk/src/ui/EventNotify.java =================================================================== --- bombus-plus/export/trunk/src/ui/EventNotify.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/EventNotify.java (working copy) @@ -66,14 +66,14 @@ //#endif private final static String tone="A6E6J6"; - //private int sndVolume; + private int sndVolume; /** Creates a new instance of EventNotify */ public EventNotify( Display display, String soundMediaType, String soundFileName, - //int sndVolume, + int sndVolume, int vibraLength, boolean enableLights ) { @@ -83,7 +83,7 @@ this.lenVibra=vibraLength; this.enableLights=enableLights; if (soundType!=null) toneSequence= soundType.equals("tone"); - //this.sndVolume=100; + this.sndVolume=sndVolume; } public void startNotify (){ @@ -104,10 +104,10 @@ player.prefetch(); -// try { -// VolumeControl vol=(VolumeControl) player.getControl("VolumeControl"); -// vol.setLevel(sndVolume); -// } catch (Exception e) { e.printStackTrace(); } + try { + VolumeControl vol=(VolumeControl) player.getControl("VolumeControl"); + vol.setLevel(sndVolume); + } catch (Exception e) { e.printStackTrace(); } player.start(); //#endif @@ -142,7 +142,7 @@ //#if USE_SIEMENS_API || !(MIDP1) int note=(tone.charAt(i++)-'A')+12*(tone.charAt(i++)-'0'); int duration=150; - Manager.playTone(note, duration, 100); + Manager.playTone(note, duration, sndVolume); Thread.sleep(duration); //#endif } Index: bombus-plus/export/trunk/src/ui/VirtualList.java =================================================================== --- bombus-plus/export/trunk/src/ui/VirtualList.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/VirtualList.java (working copy) @@ -129,7 +129,7 @@ public static int keyBack=0x1000; public static int greenKeyCode=SIEMENS_GREEN; public static boolean fullscreen=false; - public static boolean memMonitor; + //public static boolean memMonitor; /** метрика экрана */ int width; @@ -148,13 +148,13 @@ /** * окно приклеено к позиции курсора - * ПРИКЛЕИВАЕТСЯ: + * ПР?КЛЕ?ВАЕТСЯ: * при нажатии кнопок перемещения курсора * при выборе стилусом элемента списка - * ОТКЛЕИВАЕТСЯ: + * ОТКЛЕ?ВАЕТСЯ: * при использовании скролбара */ - protected boolean stickyWindow=true; + protected boolean stickyWindow=true; ///!!!!!!!!!!!!!!!!!! private int itemLayoutY[]=new int[1]; private int listHeight; @@ -351,9 +351,14 @@ g.fillRect(0,0, width, list_top); g.setColor(getTitleRGB()); title.drawItem(g,0,false); + // + int ram=(int)((Runtime.getRuntime().freeMemory()*width)/Runtime.getRuntime().totalMemory()); + g.setColor(Colors.HEAP_TOTAL); g.fillRect(0,list_top-2,width,list_top); + g.setColor(Colors.HEAP_FREE); g.fillRect(0,list_top-2,ram,list_top); + // } - drawHeapMonitor(g); + //drawHeapMonitor(g); winHeight=height-list_top; @@ -459,13 +464,13 @@ Balloon.draw(g, text); } - private void drawHeapMonitor(final Graphics g) { + /*private void drawHeapMonitor(final Graphics g) { if (memMonitor) { - int ram=(int)((Runtime.getRuntime().freeMemory()*32)/Runtime.getRuntime().totalMemory()); - g.setColor(Colors.HEAP_TOTAL); g.fillRect(width-34,0,34,3); - g.setColor(Colors.HEAP_FREE); g.fillRect(width-33,1,ram,2); + int ram=(int)((Runtime.getRuntime().freeMemory()*width)/Runtime.getRuntime().totalMemory()); + g.setColor(Colors.HEAP_TOTAL); g.fillRect(0,0,width,1); + g.setColor(Colors.HEAP_FREE); g.fillRect(0,0,ram,1); } - } + } */ // /** @@ -534,7 +539,7 @@ // если нижний край ниже окна, выровнять по низу if (bottom>win_top) win_top=bottom; } - // случай, когда курсор больше окна, и он НИЖЕ окна + // случай, когда курсор больше окна, и он Н?ЖЕ окна if (top>=win_top+winHeight) win_top=top; } catch (Exception e) { e.printStackTrace(); } } @@ -619,6 +624,7 @@ * @param keyCode код нажатой кнопки */ private void key(int keyCode) { + if (keyCode==KEY_STAR) System.gc(); //works good only with static heap!!! switch (keyCode) { case 0: break; case NOKIA_PEN: { destroyView(); break; } @@ -824,7 +830,7 @@ } /** - * событие "Нажатие ЗЕЛЁНОЙ КНОПКИ" + * событие "Нажатие ЗЕЛЁНОЙ КНОПК?" * в классе VirtualList функция выполняет вызов eventOk(). * возможно переопределить (override) функцию для реализации необходимых действий */ Index: bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java =================================================================== --- bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java (working copy) @@ -87,7 +87,7 @@ int i=0; if (result.length()==0) return result; while (i9 ) recentList.removeElementAt(i); + if ( result.equals((String)recentList.elementAt(i)) || i>14 ) recentList.removeElementAt(i); else i++; } recentList.insertElementAt(result, 0); @@ -139,7 +139,7 @@ } private void loadRecentList() { - recentList=new Vector(10); + recentList=new Vector(15);// try { DataInputStream is=NvStorage.ReadFileRecord(id, 0); Index: bombus-plus/export/trunk/src/ui/SplashScreen.java =================================================================== --- bombus-plus/export/trunk/src/ui/SplashScreen.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/SplashScreen.java (working copy) @@ -114,8 +114,10 @@ } public void setProgress(String caption, int progress){ capt=caption; +//#if DefaultConfiguration System.out.println(capt); - setProgress(progress); +//#endif + setProgress(progress); } public int getProgress(){ return pos; Index: bombus-plus/export/trunk/src/ui/Time.java =================================================================== --- bombus-plus/export/trunk/src/ui/Time.java (revision 1288) +++ bombus-plus/export/trunk/src/ui/Time.java (working copy) @@ -26,6 +26,7 @@ */ package ui; +import Client.Config; // import java.util.*; /** @@ -117,21 +118,94 @@ private final static int[] ofsFieldsB= { 0, 5, 8, 11, 14, 17 } ;//XEP-0203 + private final static int[] BombusDateTimeFields= + { 6, 3, 0, 9, 12, 14 }; //dd.mm.yy hh:mm + public static long dateIso8601(String sdate){ int[] ofs=ofsFieldsA; - if (sdate.endsWith("Z")) ofs=ofsFieldsB; - + int l=4; // yearlen + if (sdate.endsWith("Z")) { + ofs=ofsFieldsB; + } + if (sdate.length()==14) { + ofs=BombusDateTimeFields; + l=2; // yearlen + } try { - int l=4; // yearlen for (int i=0; i + long utcDate=utcTimeMillis(); + return timeLocalString(utcDate); + } + + public static String localDate(){// + long utcDate=utcTimeMillis(); + return dayLocalString(utcDate); + } + + public static String secDiffToDate(int seconds){// + String result =""; + int d = 0,h = 0,m = 0,s = 0; + if (seconds>86400){ + d=(seconds/86400); + seconds=seconds-(d*86400); + } + if (seconds>3600){ + h=(seconds/3600); + seconds=seconds-(h*3600); + } + if (seconds>60){ + m=(seconds/60); + seconds=seconds-(m*60); + } + s=seconds; + + if (d>0) { + result+= d + " " + goodWordForm (d,3); + } + if (h>0) { + if (d>0) result+=", "; + result+= h + " " + goodWordForm (h, 2); + } + if (m>0) { + if ((d>0) || (h>0)) result+=", "; + result+= m + " " + goodWordForm (m, 1); + } + if (s>0) { + if ((d>0) || (h>0) || (m>0)) result+=", "; + result+= s + " " + goodWordForm (s, 0); + } + if (result=="" && s==0) + result=s + " " + goodWordForm (s, 0); + return result; + } + + public static String goodWordForm (int d, int field) {// + String [][] suf = { + {"second", "seconds", "seconds_"}, + {"minute", "minutes", "minutes_"}, + {"hour", "hours", "hours_"}, + {"day", "days", "days_"}, + }; + int index; + if ((d%100>10) && (d%100<20) || (d%10==0) || (d%10>4)) + index=2; + else if ((d%10>1) && (d%10<5)) + index=1; + else + index=0; + return suf[field][index]; + } } - Index: bombus-plus/export/trunk/src/util/strconv.java =================================================================== --- bombus-plus/export/trunk/src/util/strconv.java (revision 1288) +++ bombus-plus/export/trunk/src/util/strconv.java (working copy) @@ -214,4 +214,49 @@ } return dst.toString(); } + + public static String stringReplace(String text, String search, String dest){ // + /*int pos = 0; + int start_pos; + int lgn = search.length(); + if (src.indexOf(search)>-1) { + while (true) { + start_pos=src.indexOf(search,pos); + pos=start_pos; + if (start_pos>-1) { + String end=src.substring(pos+lgn); + String start=src.substring(0, pos); + src=start+dest+end; + } else { + break; + } + pos=start_pos+lgn; + } + } + return src; + }*/ + String result=text; + if (result!=null && result.length()>0) { + int startpos=0; + int pos=0; + while (true) { + startpos=result.indexOf(search, pos); + if (startpos!=-1) { + result=result.substring(0, startpos)+dest+result.substring(startpos+search.length()); + pos=startpos+dest.length(); + } else + break; + } + } + return result; + } + + private static String[] chars= { "?", "\\", "/", "*", ".", "\"" , ":", "%", "@", "|", "<", ">", "COM", "LPT", "NULL", "PRINT"}; // + + public static String replaceBadChars (String src) {// + for (int i=0; i /** * @@ -44,7 +45,7 @@ if (request.getChildBlock("query")!=null) { JabberDataBlock query=addChildNs("query", "jabber:iq:time"); query.addChild("utc",ui.Time.Xep0082UtcTime()); - query.addChild("display", ui.Time.dispLocalTime()); + query.addChild("display", ui.Time.dispLocalTime()+" - , :("); } else { JabberDataBlock time=addChildNs("time", "urn:xmpp:time"); time.addChild("utc",ui.Time.utcTime()); @@ -52,4 +53,47 @@ time.addChild("tzo", ui.Time.tzOffset()); } } + + public IqTimeReply(String to) {// + super(to, Iq.TYPE_GET, "gettime"); + addChildNs("query", "jabber:iq:time");//XEP-0090 + //addChildNs("time", "urn:xmpp:time");//XEP-0202 + } + + public static String dispatchTime(JabberDataBlock data) {//XEP-0090 + if (!data.isJabberNameSpace("jabber:iq:time")) return "unknown time namespace"; + StringBuffer tm=new StringBuffer(); + String field=data.getChildBlockText("display"); + //System.out.println(field); + if (field.length()>0) { + tm.append(field); + } + return tm.toString(); + } + + /*public static String dispatchTime(JabberDataBlock data) {//XEP-0202 + if (!data.isJabberNameSpace("urn:xmpp:time")) return "unknown time namespace"; + String utc=data.getChildBlockText("utc"); + String tzo=data.getChildBlockText("tzo"); + StringBuffer tm=new StringBuffer(); + try { + long date=Time.dateIso8601(utc); + long tzoOffsetMillis=Integer.parseInt(tzo.substring(1, 3))*60*60*1000+Integer.parseInt(tzo.substring(4, 6))*60*1000; + if (tzo.startsWith("-")) + date-=tzoOffsetMillis; + else + date+=tzoOffsetMillis; + tm.append(Time.dayLocalString(date)); + tm.append(Time.timeLocalString(date)); + if (tzo.equals("Z")) { + tm.append(" (UTC"); + } else { + tm.append(" (GMT"); + tm.append(tzo); + } + tm.append(")"); + } catch (Exception e) {} + //System.out.println(tm.toString()); + return tm.toString(); + }*/ } Index: bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqVersionReply.java =================================================================== --- bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqVersionReply.java (revision 1288) +++ bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqVersionReply.java (working copy) @@ -43,7 +43,7 @@ public IqVersionReply(JabberDataBlock request) { super(request.getAttribute("from"), Iq.TYPE_RESULT, request.getAttribute("id") ); JabberDataBlock query=addChildNs("query", "jabber:iq:version"); - query.addChild("name", Version.NAME); + query.addChild("name","Bombus+ by voffk"); // query.addChild("version",Version.getVersionLang()); if (Config.getInstance().enableVersionOs) { query.addChild("os", Version.getOs()); Index: bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqLast.java =================================================================== --- bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqLast.java (revision 1288) +++ bombus-plus/export/trunk/src/com/alsutton/jabber/datablocks/IqLast.java (working copy) @@ -45,4 +45,20 @@ long last=(Time.utcTimeMillis()-lastMessageTime)/1000; query.setAttribute("seconds", String.valueOf(last)); } + + public IqLast(String to) {// + super(to, Iq.TYPE_GET, "getlast"); + addChildNs("query", "jabber:iq:last"); + } + + public static String dispatchLast(JabberDataBlock data) {// + if (!data.isJabberNameSpace("jabber:iq:last")) return "unknown last namespace"; + StringBuffer tm=new StringBuffer(); + String field=data.getAttribute("seconds"); + if (field!=null) { + tm.append(Time.secDiffToDate(Integer.parseInt(field))); + } + //System.out.println(tm.toString()); + return tm.toString(); + } } Index: bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java =================================================================== --- bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java (revision 1288) +++ bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java (working copy) @@ -34,7 +34,7 @@ public class JabberDataBlock { - private final static int MAX_CHILDS=400; + private final static int MAX_CHILDS=/*400*/200; // /** * The name of this tag */ Index: bombus-plus/export/trunk/src/com/alsutton/xmlparser/XMLParser.java =================================================================== --- bombus-plus/export/trunk/src/com/alsutton/xmlparser/XMLParser.java (revision 1288) +++ bombus-plus/export/trunk/src/com/alsutton/xmlparser/XMLParser.java (working copy) @@ -54,7 +54,12 @@ //# public static final int MAX_BLOCK_SIZE=4096-3; //max array for m55=4096? //#endif - private final static int MAX_BIN_DATASIZE=64*1024; //64 KB - experimental + private final static int MAX_BIN_DATASIZE= +//#if ReleaseZVOFFK +//# 40*1024; +//#else + 64*1024; //64 KB - experimental +//#endif /** Constructor, Used to override default dispatcher. * Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java =================================================================== --- bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java (revision 1288) +++ bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java (working copy) @@ -41,7 +41,9 @@ static final private int Z_DEFAULT_COMPRESSION=-1; -//#ifdef JZLIB_STD_DEFLATE_BUFS +// +//#if MAX_COMPRESSION +//# ///#ifdef JZLIB_STD_DEFLATE_BUFS //# // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) //# static final private int MAX_WBITS=15; // 32K LZ77 window //# static final private int DEF_MEM_LEVEL=8; Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java =================================================================== --- bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java (revision 1288) +++ bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java (working copy) @@ -35,9 +35,14 @@ package com.jcraft.jzlib; final class Inflate{ - - static final public int MAX_WBITS=15; // 32K LZ77 window +// +//#if !(MAX_COMPRESSION) + static final public int MAX_WBITS=15; // 32K LZ77 window +//#else +//# static final private int MAX_WBITS=15; // 32K LZ77 window +//#endif + // preset dictionary flag in zlib header static final private int PRESET_DICT=0x20; Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java =================================================================== --- bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java (revision 1288) +++ bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java (working copy) @@ -36,9 +36,15 @@ final public class ZStream{ +// +//#if !(MAX_COMPRESSION) //static final private int MAX_WBITS=15; // 32K LZ77 window //static final private int DEF_WBITS=MAX_WBITS; - +//#else +//# static final private int MAX_WBITS=15; // 32K LZ77 window +//# static final private int DEF_WBITS=MAX_WBITS; +//#endif + static final private int Z_NO_FLUSH=0; static final private int Z_PARTIAL_FLUSH=1; static final private int Z_SYNC_FLUSH=2; @@ -77,12 +83,23 @@ public long adler; Adler32 _adler=new Adler32(); +// +//#if !(MAX_COMPRESSION) public int inflateInit(){ return inflateInit(Inflate.MAX_WBITS); } public int inflateInit(boolean nowrap){ return inflateInit(Inflate.MAX_WBITS, nowrap); } +//#else +//# public int inflateInit(){ +//# return inflateInit(MAX_WBITS); +//# } +//# public int inflateInit(boolean nowrap){ +//# return inflateInit(MAX_WBITS, nowrap); +//# } +//#endif + public int inflateInit(int w){ return inflateInit(w, false); } @@ -113,12 +130,23 @@ return istate.inflateSetDictionary(this, dictionary, dictLength); } +// +//#if !(MAX_COMPRESSION) public int deflateInit(int level){ return deflateInit(level, Deflate.MAX_WBITS); } public int deflateInit(int level, boolean nowrap){ return deflateInit(level, Deflate.MAX_WBITS, nowrap); } +//#else +//# public int deflateInit(int level){ +//# return deflateInit(level, MAX_WBITS); +//# } +//# public int deflateInit(int level, boolean nowrap){ +//# return deflateInit(level, MAX_WBITS, nowrap); +//# } +//#endif + public int deflateInit(int level, int bits){ return deflateInit(level, bits, false); } @@ -162,9 +190,8 @@ next_out.length<=next_out_index || dstate.pending_buf.length<(dstate.pending_out+len) || next_out.length<(next_out_index+len)){ - System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+ - ", "+next_out.length+", "+next_out_index+", "+len); - System.out.println("avail_out="+avail_out); + //System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+", "+next_out.length+", "+next_out_index+", "+len); + //System.out.println("avail_out="+avail_out); } System.arraycopy(dstate.pending_buf, dstate.pending_out, Index: bombus-plus/export/trunk/src/midlet/Bombus.java =================================================================== --- bombus-plus/export/trunk/src/midlet/Bombus.java (revision 1288) +++ bombus-plus/export/trunk/src/midlet/Bombus.java (working copy) @@ -118,15 +118,14 @@ s.setProgress(23); sd.roster=new Roster(display); - - if (!selAccount) { + // + if (!selAccount /*&& cf.autoLogin*/) { // connect whithout account select - boolean autologin=cf.autoLogin; - selAccount=(Account.loadAccount(autologin)==null); - if (!autologin) s.close(); - } - if (selAccount) { new AccountSelect(display, true); } + selAccount=( Account.loadAccount(cf.autoLogin)==null ); + if (!cf.autoLogin) s.close(); + } else { new AccountSelect(display, true); } } + // /** * Destroy must cleanup everything not handled by the garbage collector. Index: bombus-plus/export/trunk/src/Client/ContactEdit.java =================================================================== --- bombus-plus/export/trunk/src/Client/ContactEdit.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/ContactEdit.java (working copy) @@ -272,12 +272,16 @@ StringBuffer jidBuf=new StringBuffer(jid); int at=jid.indexOf('@'); - if (at<0) at=tJid.size(); - - jidBuf.setLength(at); + // + if (at>=0) { + jidBuf.deleteCharAt(at); + jidBuf.insert(at, '%'); + } jidBuf.append('@'); jidBuf.append(transport); tJid.setString(jidBuf.toString()); + jidBuf=null; + // } if (item==tJid) { String s1=tJid.getString(); Index: bombus-plus/export/trunk/src/Client/Config.java =================================================================== --- bombus-plus/export/trunk/src/Client/Config.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Config.java (working copy) @@ -52,11 +52,6 @@ public final static int AWAY_OFF=0; public final static int AWAY_LOCK=1; public final static int AWAY_IDLE=2; - - public final static int SUBSCR_AUTO=0; - public final static int SUBSCR_ASK=1; - public final static int SUBSCR_DROP=2; - public final static int SUBSCR_REJECT=3; public final int vibraLen=getIntProperty("vibra_len",500); @@ -68,12 +63,12 @@ public int socketRCVBUF=getIntProperty("RCVBUF",-1); public int socketSNDBUF=getIntProperty("SNDBUF",-1);*/ - public boolean ghostMotor=getBooleanProperty("moto_e398",false); + public boolean ghostMotor=false;//getBooleanProperty("moto_e398",false); public boolean blFlash=!ghostMotor; //true; - public boolean msgLog=getBooleanProperty("msg_log",false); + //public boolean msgLog=getBooleanProperty("msg_log",false); // - public boolean muc119=getBooleanProperty("muc_119",true); // before muc 1.19 use muc#owner instead of muc#admin + //public boolean muc119=getBooleanProperty("muc_119",true); // before muc 1.19 use muc#owner instead of muc#admin // public int soundsMsgIndex=0; @@ -95,14 +90,14 @@ //# public char keyVibra=getCharProperty("key_vibra",'*'); //#endif - public char keyHide=getCharProperty("key_hide",'9'); + //public char keyHide=getCharProperty("key_hide",'9'); public char keyOfflines=getCharProperty("key_offlines",'0'); //#if USE_LED_PATTERN //# public int m55LedPattern=0; //#endif - public String defGcRoom=getStringProperty("gc_room","bombus@conference.jabber.ru"); + //public String defGcRoom=getStringProperty("gc_room","bombus@conference.jabber.ru"); // //public String xmlLang=getStringProperty("xml_lang",null); @@ -113,27 +108,28 @@ public int def_profile=0; public boolean smiles=true; public boolean showOfflineContacts=true; - public boolean showTransports=true; - public boolean selfContact=false; + /*public boolean showTransports=true; + public boolean selfContact=true; */ // //public boolean notInList=true; - public int notInListDropLevel=NotInListFilter.ALLOW_ALL; //enable all + //public int notInListDropLevel=NotInListFilter.ALLOW_ALL; //enable all // public boolean ignore=false; - public boolean eventComposing=true; + public boolean eventComposing=false; public boolean eventDelivery=true; public boolean storeConfPresence=true; - public boolean autoLogin=true; + public boolean autoLogin=false; public boolean autoJoinConferences=false; - public boolean autoFocus=true; + public boolean autoFocus=false; + public int gmtOffset; public int locOffset; public boolean popupFromMinimized=true; - public boolean memMonitor; + //public boolean memMonitor; public int font1=0; public int font2=0; @@ -145,15 +141,33 @@ public boolean capsState=false; //FS#748 public int textWrap=0; - public int autoSubscribe=SUBSCR_ASK; + public boolean autoSubscribe=false; public int autoAwayType=0; public int autoAwayDelay=5; //5 minutes public boolean enableVersionOs=true; - public int messageCollapsedLength=512; + public int messageCollapsedLength=1000; // + // + public boolean lastAppearedContacts=false; + public int def_status=0; + public int maxReconnect=10; +//#if ARCHIVE_ADVANCED + public boolean cp1251=true; +//#endif +//#if TRAFFIC +//# public boolean showTraffic=false; +//#endif +//#if LIGHT_CONTROL +//# public boolean lightState=false; +//#endif +//#if !ReleaseZVOFFK + public boolean notInListPresences=true; +//#endif + // + // runtime values public boolean allowMinimize=false; public int profile=0; @@ -220,9 +234,6 @@ VirtualList.keyClear=0x1000; } - if (platform.indexOf("9@9")>0) { - istreamWaiting=false; //is it critical for phillips xenium? - } /*if (platform.startsWith("j2me")) { greenKeyCode=VirtualList.MOTOROLA_GREEN; VirtualList.keyClear=0x1000; @@ -250,9 +261,9 @@ fullscreen=inputStream.readBoolean(); def_profile = inputStream.readInt(); smiles=inputStream.readBoolean(); - showTransports=inputStream.readBoolean(); - selfContact=inputStream.readBoolean(); - /*notInList=*/ inputStream.readBoolean(); + /*showTransports=inputStream.readBoolean(); + selfContact=inputStream.readBoolean(); */ // + // /*notInList=*/ inputStream.readBoolean(); */ ignore=inputStream.readBoolean(); eventComposing=inputStream.readBoolean(); @@ -260,24 +271,24 @@ locOffset=inputStream.readInt(); soundsMsgIndex=inputStream.readInt(); - soundVol=inputStream.readInt(); - + soundVol=inputStream.readInt(); // + autoLogin=inputStream.readBoolean(); autoJoinConferences=inputStream.readBoolean(); - notInListDropLevel=inputStream.readInt(); + //notInListDropLevel=inputStream.readInt(); popupFromMinimized=inputStream.readBoolean(); blFlash=inputStream.readBoolean(); - memMonitor=inputStream.readBoolean(); + //memMonitor=inputStream.readBoolean(); font1=inputStream.readInt(); font2=inputStream.readInt(); autoFocus=inputStream.readBoolean(); - colorTheme=inputStream.readInt(); + messageCollapsedLength=inputStream.readInt(); storeConfPresence=inputStream.readBoolean(); @@ -285,7 +296,7 @@ textWrap=inputStream.readInt(); - /*autoSubscribe=*/inputStream.readBoolean(); + autoSubscribe=inputStream.readBoolean(); autoAwayType=inputStream.readInt(); autoAwayDelay=inputStream.readInt(); @@ -296,10 +307,34 @@ eventDelivery=inputStream.readBoolean(); - messageCollapsedLength=inputStream.readInt(); - - autoSubscribe=inputStream.readInt(); + lastAppearedContacts=inputStream.readBoolean(); // +//#if TRAFFIC +//# showTraffic=inputStream.readBoolean(); // +//#else + inputStream.readBoolean(); +//#endif + + colorTheme=inputStream.readInt(); + + def_status=inputStream.readInt(); // + + maxReconnect=inputStream.readInt(); // +//#if ARCHIVE_ADVANCED + cp1251=inputStream.readBoolean(); // +//#else +//# inputStream.readBoolean(); +//#endif +//#if LIGHT_CONTROL +//# lightState=inputStream.readBoolean(); // +//#else + inputStream.readBoolean(); +//#endif +//#if !ReleaseZVOFFK + notInListPresences=inputStream.readBoolean(); +//#else +//# inputStream.readBoolean(); +//#endif inputStream.close(); } catch (Exception e) { e.printStackTrace(); @@ -309,7 +344,7 @@ if (lastProfile==AlertProfile.VIBRA) lastProfile=0; updateTime(); VirtualList.fullscreen=fullscreen; - VirtualList.memMonitor=memMonitor; + //VirtualList.memMonitor=memMonitor; } public void loadSoundName(){ @@ -318,6 +353,8 @@ messageSndType=(String) files[0].elementAt(soundsMsgIndex); messagesnd=(String) files[1].elementAt(soundsMsgIndex); } + +//#if !(ReleaseZLITE) public String langFileName(){ if (lang==null) { //auto-detecting @@ -336,6 +373,7 @@ } return null; //unknown language ->en } +//#endif //#if COLOR_THEMES public String themeFileName() { @@ -356,9 +394,9 @@ outputStream.writeBoolean(fullscreen); outputStream.writeInt(def_profile); outputStream.writeBoolean(smiles); - outputStream.writeBoolean(showTransports); - outputStream.writeBoolean(selfContact); - outputStream.writeBoolean(true /*notInList*/); + /*outputStream.writeBoolean(showTransports); + outputStream.writeBoolean(selfContact); */ // + //outputStream.writeBoolean(true /*notInList*/); outputStream.writeBoolean(ignore); outputStream.writeBoolean(eventComposing); @@ -366,24 +404,24 @@ outputStream.writeInt(locOffset); outputStream.writeInt(soundsMsgIndex); - outputStream.writeInt(soundVol); + outputStream.writeInt(soundVol); // outputStream.writeBoolean(autoLogin); outputStream.writeBoolean(autoJoinConferences); - outputStream.writeInt(notInListDropLevel /*keepAlive*/); + //outputStream.writeInt(notInListDropLevel /*keepAlive*/); outputStream.writeBoolean(popupFromMinimized); outputStream.writeBoolean(blFlash); - outputStream.writeBoolean(memMonitor); + //outputStream.writeBoolean(memMonitor); outputStream.writeInt(font1); outputStream.writeInt(font2); outputStream.writeBoolean(autoFocus); - outputStream.writeInt(colorTheme); + outputStream.writeInt(messageCollapsedLength); outputStream.writeBoolean(storeConfPresence); @@ -391,7 +429,7 @@ outputStream.writeInt(textWrap); - outputStream.writeBoolean(false /*autoSubscribe*/); + outputStream.writeBoolean(autoSubscribe); outputStream.writeInt(autoAwayType); outputStream.writeInt(autoAwayDelay); @@ -402,10 +440,34 @@ outputStream.writeBoolean(eventDelivery); - outputStream.writeInt(messageCollapsedLength); + outputStream.writeBoolean(lastAppearedContacts); // - outputStream.writeInt(autoSubscribe); - +//#if TRAFFIC +//# outputStream.writeBoolean(showTraffic); // +//#else + outputStream.writeBoolean(false); +//#endif + + outputStream.writeInt(colorTheme); + + outputStream.writeInt(def_status); // + + outputStream.writeInt(maxReconnect); // +//#if ARCHIVE_ADVANCED + outputStream.writeBoolean(cp1251); // +//#else +//# outputStream.writeBoolean(true); +//#endif +//#if LIGHT_CONTROL +//# outputStream.writeBoolean(lightState); // +//#else + outputStream.writeBoolean(false); +//#endif +//#if !ReleaseZVOFFK + outputStream.writeBoolean(notInListPresences); // +//#else +//# outputStream.writeBoolean(true); +//#endif } catch (Exception e) { e.printStackTrace(); } NvStorage.writeFileRecord(outputStream, "config", 0, true); @@ -444,7 +506,7 @@ return defvalue; } - public final boolean getBooleanProperty(final String key, final boolean defvalue) { + /*public final boolean getBooleanProperty(final String key, final boolean defvalue) { try { String s=Bombus.getInstance().getAppProperty(key); if (s.equals("true")) return true; @@ -454,6 +516,6 @@ } catch (Exception e) { } // возвращает defvalue, если атрибут не существует return defvalue; - } + }*/ } Index: bombus-plus/export/trunk/src/Client/ActiveContacts.java =================================================================== --- bombus-plus/export/trunk/src/Client/ActiveContacts.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/ActiveContacts.java (working copy) @@ -97,7 +97,42 @@ } public void keyPressed(int keyCode) { - if (keyCode==KEY_NUM3) destroyView(); - else super.keyPressed(keyCode); + if (keyCode==KEY_NUM3) { + destroyView(); + } else if (keyCode==keyClear) { + Contact c=(Contact)getFocusedObject(); + c.purge(); + } + else if (keyCode==KEY_NUM0) { + if (getItemCount()<1) + return; + Contact c=(Contact)getFocusedObject(); + + Enumeration i=activeContacts.elements(); + + int pass=0; // 0=ищем курсор, 1=ищем + while (pass<2) { + if (!i.hasMoreElements()) i=activeContacts.elements(); + Contact p=(Contact)i.nextElement(); + if (pass==1) + if (p.getNewMsgsCount()>0) { + focusToContact(p); + setRotator(); + break; + } + if (p==c) pass++; // полный круг пройден + } + return; + } else super.keyPressed(keyCode); } -} + + private void focusToContact(final Contact c) { + int index=activeContacts.indexOf(c); + if (index>=0) + moveCursorTo(index); + } + + protected void keyGreen(){ + eventOk(); + } +} \ No newline at end of file Index: bombus-plus/export/trunk/src/Client/RosterItemActions.java =================================================================== --- bombus-plus/export/trunk/src/Client/RosterItemActions.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/RosterItemActions.java (working copy) @@ -27,7 +27,7 @@ package Client; -import Conference.ConferenceForm; +//import Conference.ConferenceForm; import Conference.ConferenceGroup; import Conference.affiliation.ConferenceQuickPrivelegeModify; import Conference.InviteForm; @@ -50,6 +50,10 @@ import ui.YesNoAlert; import vcard.VCard; import vcard.vCardForm; +// +import com.alsutton.jabber.datablocks.IqLast; +import com.alsutton.jabber.datablocks.IqTimeReply; +// /** * @@ -84,18 +88,23 @@ } //if (contact.group==Groups.SELF_INDEX) addItem("Commands",30); - addItem(SR.MS_VCARD,1); - addItem(SR.MS_CLIENT_INFO,0); - addItem(SR.MS_COMMANDS,30); + // + addItem(SR.MS_CLIENT_INFO,0); + addItem(SR.MS_VCARD,1); if (contact.getGroupType()!=Groups.TYPE_SELF && contact.getGroupType()!=Groups.TYPE_SEARCH_RESULT && contact.origin + if (contact.origin==Contact.ORIGIN_GROUPCHAT) return; //TODO: подключить тот же список, что и для ConferenceGroup if (contact instanceof MucContact) { @@ -304,6 +313,26 @@ return; } //#endif + case 100: // uptime & seen + { + roster.setQuerySign(true); + roster.theStream.send(new IqLast(c.getBareJid())); + break; + } + + case 101: // idle + { + roster.setQuerySign(true); + roster.theStream.send(new IqLast(c.getJid())); + break; + } + + case 102: // time + { + roster.setQuerySign(true); + roster.theStream.send(new IqTimeReply(c.getJid())); + break; + } } if (c instanceof MucContact || g instanceof ConferenceGroup) { Index: bombus-plus/export/trunk/src/Client/Roster.java =================================================================== --- bombus-plus/export/trunk/src/Client/Roster.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Roster.java (working copy) @@ -42,6 +42,9 @@ //#endif import locale.SR; import login.LoginListener; +//#if NONSASL_ENABLE +//# import login.NonSASLAuth; +//#endif import login.SASLAuth; import midlet.Bombus; import vcard.VCard; @@ -59,6 +62,7 @@ import Conference.ConferenceForm; import PrivacyLists.PrivacySelect; import Client.Config; +import util.strconv; // //import Client.msg.*; @@ -109,6 +113,20 @@ boolean autoAway; +//#if ReleaseZVOFFK +//# private Command cmdActions=new Command(SR.MS_ITEM_ACTIONS, Command.SCREEN, 1); +//# private Command cmdConference=new Command(SR.MS_CONFERENCE, Command.SCREEN, 2); +//# private Command cmdStatus=new Command(SR.MS_STATUS_MENU, Command.SCREEN, 3); +//# private Command cmdAlert=new Command(SR.MS_ALERT_PROFILE_CMD, Command.SCREEN, 8); +//# private Command cmdActiveContact;//=new Command(SR.MS_ACTIVE_CONTACTS, Command.SCREEN, 3); +//# private Command cmdArchive=new Command(SR.MS_ARCHIVE, Command.SCREEN, 10); +//# private Command cmdAdd=new Command(SR.MS_ADD_CONTACT, Command.SCREEN, 12); +//# private Command cmdTools=new Command(SR.MS_TOOLS, Command.SCREEN, 14); +//# private Command cmdAccount=new Command(SR.MS_ACCOUNT_, Command.SCREEN, 15); +//# private Command cmdInfo=new Command(SR.MS_ABOUT, Command.SCREEN, 80); +//# private Command cmdMinimize=new Command(SR.MS_APP_MINIMIZE, Command.SCREEN, 90); +//# private Command cmdQuit=new Command(SR.MS_APP_QUIT, Command.SCREEN, 99); +//#else private Command cmdActions=new Command(SR.MS_ITEM_ACTIONS, Command.SCREEN, 1); private Command cmdStatus=new Command(SR.MS_STATUS_MENU, Command.SCREEN, 2); private Command cmdActiveContact;//=new Command(SR.MS_ACTIVE_CONTACTS, Command.SCREEN, 3); @@ -121,8 +139,9 @@ private Command cmdInfo=new Command(SR.MS_ABOUT, Command.SCREEN, 80); private Command cmdMinimize=new Command(SR.MS_APP_MINIMIZE, Command.SCREEN, 90); private Command cmdQuit=new Command(SR.MS_APP_QUIT, Command.SCREEN, 99); +//#endif - private Config cf; + /*private Config cf;*/private Config cf=Config.getInstance(); // private StaticData sd=StaticData.getInstance(); // #if (MOTOROLA_BACKLIGHT) @@ -133,8 +152,14 @@ private String token; private long lastMessageTime=Time.utcTimeMillis(); - - private final static int maxReconnect=5; + + // + private String myMessage; + private final String TIME_REP="%t"; + private final String DATE_REP="%d"; + + //private final static int maxReconnect=5; + // private int reconnectCount; private AutoStatusTask autostatus; @@ -151,9 +176,11 @@ //setTitleImages(StaticData.getInstance().rosterIcons); this.display=display; +//#if LIGHT_CONTROL +//# setLight(cf.lightState); +//#endif + //cf=Config.getInstance(); - cf=Config.getInstance(); - //canback=false; // We can't go back using keyBack //msgNotify=new EventNotify(display, Profile.getProfile(0) ); @@ -176,7 +203,7 @@ if (platform.startsWith("Nokia")) activeType=Command.BACK; if (platform.startsWith("Intent")) activeType=Command.BACK; - cmdActiveContact=new Command(SR.MS_ACTIVE_CONTACTS, activeType, 3); + cmdActiveContact=new Command(SR.MS_ACTIVE_CONTACTS, activeType, 10); // <1> addCommand(cmdStatus); addCommand(cmdActions); @@ -241,6 +268,35 @@ getTitleItem().setElementAt(s, 3); } + private void setRosterTitle(){ // + StringBuffer title= new StringBuffer(); + title.append("("); + title.append(groups.getRosterOnline()); + title.append("/"); + title.append(groups.getRosterContacts()); + title.append(") "); + title.append(Time.localTime()); + title.append(" "); +//#if TRAFFIC +//# if (cf.showTraffic) { +//# int bytes=0; +//# try { +//# bytes=theStream.getTrafficBytes()*2/1024; //;-) +//# } catch (NullPointerException e) { +//# bytes=0; +//# } +//# title.append(bytes); +//# title.append(" kb"); +//# } else { +//# title.append(Time.localDate()); +//# } +//#else + title.append(Time.localDate()); +//#endif + setRosterTitle(title.toString()); + title=null; + } + private int rscaler; private int rpercent; @@ -302,7 +358,7 @@ bookmarks=null; } setMyJid(new Jid(sd.account.getJid())); - updateContact(sd.account.getNick(), myJid.getBareJid(), SR.MS_SELF_CONTACT, "self", false); + updateContact(sd.account.getNick(), myJid.getBareJid(), /*SR.MS_SELF_CONTACT*/ "self-contacts", "self", false); // System.gc(); } @@ -338,8 +394,9 @@ if (transferIcon!=null) return transferIcon; return messageIcon; } - + private void updateTitle(){ + setRosterTitle(); // int s=querysign?RosterIcons.ICON_PROGRESS_INDEX:myStatus; int profile=cf.profile;//StaticData.getInstance().config.profile; Object en=(profile>1)? new Integer(profile+RosterIcons.ICON_PROFILE_INDEX):null; @@ -351,7 +408,7 @@ title.setElementAt(null,1); } else { messageIcon=new Integer(RosterIcons.ICON_MESSAGE_INDEX); - title.setElementAt(" "+messageCount+" ",1); + title.setElementAt(" "+messageCount, 1); // } title.setElementAt(messageIcon, 0); } @@ -473,6 +530,11 @@ firstInstance=false; //end of FS#712 workaround + // + Group g=c.getGroup(); + if (g.type!=Groups.TYPE_TRANSP && g.type!=Groups.TYPE_NOT_IN_LIST) + g.collapsed=true; + // c.setSortKey((nick==null)? jid:nick); } } @@ -657,8 +719,11 @@ * Method to inform the server we are now online */ - public void sendPresence(int status) { + public void sendPresence(int status, String message) { myStatus=status; + if (message!=null) + myMessage=message; + setQuerySign(false); if (myStatus!=Presence.PRESENCE_OFFLINE) { lastOnlineStatus=myStatus; @@ -677,14 +742,23 @@ // send presence ExtendedStatus es= StatusList.getInstance().getStatus(myStatus); - Presence presence = new Presence(myStatus, es.getPriority(), es.getMessage(), StaticData.getInstance().account.getNick()); + + // + if (isLoggedIn()) { - if (status==Presence.PRESENCE_OFFLINE) groups.queryGroupState(false); - + //if (status==Presence.PRESENCE_OFFLINE) groups.queryGroupState(false); if (!StaticData.getInstance().account.isMucOnly() ) theStream.send( presence ); - multicastConferencePresence(); + multicastConferencePresence(myMessage); // disconnect if (status==Presence.PRESENCE_OFFLINE) { @@ -697,6 +771,7 @@ Contact c=(Contact)e.nextElement(); //if (c.status } } @@ -713,11 +788,19 @@ public void sendDirectPresence(int status, String to, JabberDataBlock x) { if (to==null) { - sendPresence(status); + sendPresence(status, null); return; } ExtendedStatus es= StatusList.getInstance().getStatus(status); - Presence presence = new Presence(status, es.getPriority(), es.getMessage(), StaticData.getInstance().account.getNick()); + + // + myMessage=es.getMessage(); + + myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() ); + myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() ); + + Presence presence = new Presence(status, es.getPriority(), myMessage, StaticData.getInstance().account.getNick()); + // presence.setTo(to); if (x!=null) presence.addChild(x); @@ -741,7 +824,7 @@ return getContact(myJid.getJid(), false); } - public void multicastConferencePresence() { + public void multicastConferencePresence(String message) { if (myStatus==Presence.PRESENCE_INVISIBLE) return; //block multicasting presence invisible ExtendedStatus es= StatusList.getInstance().getStatus(myStatus); for (Enumeration e=hContacts.elements(); e.hasMoreElements();) { @@ -757,7 +840,17 @@ continue; } - Presence presence = new Presence(myStatus, es.getPriority(), es.getMessage(), null); + // + if (message!=null) + myMessage=message; + else + myMessage=es.getMessage(); + + myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() ); + myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() ); + Presence presence = new Presence(myStatus, es.getPriority(), myMessage, null); + // + presence.setTo(myself.getJid()); theStream.send(presence); } @@ -868,7 +961,7 @@ if (k.jid.getServer().equals(transport) && k.nick==null && (grpType==Groups.TYPE_COMMON || grpType==Groups.TYPE_NO_GROUP)) { vCardQueue.addElement(VCard.getQueryVCard(k.getJid(), "nickvc"+k.bareJid)); - System.out.println(k.toString()); + //System.out.println(k.toString()); } } setQuerySign(true); @@ -925,7 +1018,7 @@ // залогинились. теперь, если был реконнект, то просто пошлём статус if (reconnect) { querysign=reconnect=false; - sendPresence(myStatus); + sendPresence(myStatus, null); // return; } @@ -1000,6 +1093,10 @@ return JabberBlockListener.BLOCK_PROCESSED; } + //if ( type.equals( "error" ) ) { + //TODO: handlers for type='error'? + //} + if (id.equals("getver")) { String body=null; if (type.equals("error")) { @@ -1021,19 +1118,65 @@ } // } + + if (id.equals("getlast")) {// + from=data.getAttribute("from"); + String body=null; + if (type.equals("error")) { + body="error"; + querysign=false; + } else if (type.equals("result")) { + JabberDataBlock tm=data.getChildBlock("query"); + if (tm!=null) { + body=IqLast.dispatchLast(tm); + } + querysign=false; + } + if (body!=null) { + String lastType="Online time/seen"; + if (from.indexOf("/")>-1) lastType=SR.MS_IDLE; + String status=(data.getChildBlockText("query").length()!=0)?" ("+data.getChildBlockText("query")+")":""; + Msg m=new Msg(Msg.MESSAGE_TYPE_IN, from, lastType, body+status); + messageStore( getContact(from, false), m); + redraw(); + return JabberBlockListener.BLOCK_PROCESSED; + } + } + + if (id.equals("gettime")) {// + from=data.getAttribute("from"); + String body=null; + if (type.equals("error")) { + body="error"; + querysign=false; + } else if (type.equals("result")) { + JabberDataBlock tm=data.getChildBlock(/*"time"*/"query"); + if (tm!=null) { + body=IqTimeReply.dispatchTime(tm); + } + querysign=false; + } + if (body!=null) { + Msg m=new Msg(Msg.MESSAGE_TYPE_IN, from, SR.MS_TIME, body); + messageStore( getContact(from, false), m); + redraw(); + return JabberBlockListener.BLOCK_PROCESSED; + } + } + if (id.equals("getros")) if (type.equals("result")) { // а вот и ростер подошёл :) theStream.enableRosterNotify(false); processRoster(data); - groups.queryGroupState(true); + //groups.requestGroupState(true); // setProgress(SR.MS_CONNECTED,100); reEnumRoster(); // теперь пошлём присутствие querysign=reconnect=false; - sendPresence(myStatus); + sendPresence(myStatus, null); // //sendPresence(Presence.PRESENCE_INVISIBLE); SplashScreen.getInstance().close(); // display.setCurrent(this); @@ -1050,20 +1193,24 @@ } else if (type.equals("get")){ JabberDataBlock query=data.getChildBlock("query"); + Contact c=getContact(from, true); // if (query!=null){ // проверяем на запрос версии клиента if (query.isJabberNameSpace("jabber:iq:version")) { + c.setIncoming(Contact.INC_VIEWING); // theStream.send(new IqVersionReply(data)); return JabberBlockListener.BLOCK_PROCESSED; } // проверяем на запрос локального времени клиента //DEPRECATED if (query.isJabberNameSpace("jabber:iq:time")) { + c.setIncoming(Contact.INC_VIEWING); // theStream.send(new IqTimeReply(data)); return JabberBlockListener.BLOCK_PROCESSED; } // проверяем на запрос idle if (query.isJabberNameSpace("jabber:iq:last")) { + c.setIncoming(Contact.INC_VIEWING); // theStream.send(new IqLast(data, lastMessageTime)); return JabberBlockListener.BLOCK_PROCESSED; } @@ -1072,12 +1219,14 @@ // проверяем на запрос локального времени клиента XEP-0202 if (data.findNamespace("time", "urn:xmpp:time")!=null) { + c.setIncoming(Contact.INC_VIEWING); // theStream.send(new IqTimeReply(data)); return JabberBlockListener.BLOCK_PROCESSED; } // xep-0199 ping if (data.findNamespace("ping", "urn:xmpp:ping")!=null) { + c.setIncoming(Contact.INC_VIEWING); // Iq pong=new Iq(from, Iq.TYPE_RESULT, data.getAttribute("id")); theStream.send(pong); return JabberBlockListener.BLOCK_PROCESSED; @@ -1182,8 +1331,9 @@ } } catch (Exception e) { /* not muc#user case*/ } - Contact c=getContact(from, cf.notInListDropLevel != NotInListFilter.DROP_MESSAGES_PRESENCES); - if (c==null) return JabberBlockListener.BLOCK_REJECTED; //not-in-list message dropped + Contact c=getContact(from, true); // + /*Contact c=getContact(from, cf.notInListDropLevel != NotInListFilter.DROP_MESSAGES_PRESENCES); + if (c==null) return JabberBlockListener.BLOCK_REJECTED; //not-in-list message dropped */ // if (name==null) name=c.getName(); // /me @@ -1303,16 +1453,18 @@ if (xmuc!=null) try { MucContact c = mucContact(from); - int rp=from.indexOf('/'); String name=from.substring(rp+1); from=from.substring(0, rp); + ConferenceGroup currentGroup=(ConferenceGroup)groups.getGroup(from); // + String myNick=currentGroup.getSelfContact().nick; // Msg chatPresence=new Msg( Msg.MESSAGE_TYPE_PRESENCE, name, null, c.processPresence(xmuc, pr) ); if (cf.storeConfPresence || + chatPresence.getBody().indexOf(myNick)>-1 /*voffk*/|| chatPresence.getBody().indexOf(SR.MS_WAS_BANNED)>-1 || chatPresence.getBody().indexOf(SR.MS_WAS_KICKED)>-1) { messageStore(getContact(from, false), chatPresence); @@ -1325,44 +1477,52 @@ } /* if (muc) */ catch (Exception e) { /*e.printStackTrace();*/ } else { //processing presences - Contact c=null; + /*boolean enNIL= cf.notInListDropLevel > NotInListFilter.DROP_PRESENCES; + if (ti==Presence.PRESENCE_AUTH_ASK) enNIL=true; + Contact c=getContact(from, enNIL); + if (c==null) return JabberBlockListener.BLOCK_REJECTED; //drop not-in-list presence */ // +//#if !ReleaseZVOFFK + boolean enNIL=cf.notInListPresences; + if (ti==Presence.PRESENCE_AUTH_ASK) enNIL=true; + Contact c=getContact(from, enNIL); + if (c==null) return JabberBlockListener.BLOCK_REJECTED; +//#else +//# Contact c=getContact(from, true); +//#endif + + messageStore(c, m); if (ti==Presence.PRESENCE_AUTH_ASK) { - //processing subscriptions - if (cf.autoSubscribe==Config.SUBSCR_DROP) return JabberBlockListener.BLOCK_REJECTED; - - if (cf.autoSubscribe==Config.SUBSCR_REJECT) { - //System.out.println(from+": decline subscription"); - - sendPresence(from, "unsubscribed", null); - return JabberBlockListener.BLOCK_PROCESSED; - } - - c=getContact(from, true); - messageStore(c, m); - - if (cf.autoSubscribe==Config.SUBSCR_AUTO) { + if (cf.autoSubscribe) { doSubscribe(c); messageStore(c, new Msg(Msg.MESSAGE_TYPE_AUTH, from, null, SR.MS_AUTH_AUTO)); } - } else { - // processing presences - boolean enNIL= cf.notInListDropLevel > NotInListFilter.DROP_PRESENCES; - c=getContact(from, enNIL); - - if (c==null) return JabberBlockListener.BLOCK_REJECTED; //drop not-in-list presence - - messageStore(c, m); } c.priority=pr.getPriority(); if (ti>=0) c.setStatus(ti); - if (c.nick==null && c.status<=Presence.PRESENCE_DND) { + if ((c.nick==null && c.status<=Presence.PRESENCE_DND && c.getGroupType()!=Groups.TYPE_TRANSP)) {// JabberDataBlock nick = pr.findNamespace("nick", "http://jabber.org/protocol/nick"); if (nick!=null) c.nick=nick.getText(); //todo: optionaly update roster } + + // + if (cf.lastAppearedContacts /*&& notifyReady(-111) ///////////////*/ && + (ti==Presence.PRESENCE_ONLINE || ti==Presence.PRESENCE_CHAT)) { + if (c.getGroupType()!=Groups.TYPE_TRANSP) c.setIncoming(Contact.INC_APPEARING); + } + if (ti==Presence.PRESENCE_OFFLINE) { + c.setIncoming(Contact.INC_NONE); + c.setComposing(false); + } + /*if (ti>=0) { + if ((ti==Presence.PRESENCE_ONLINE || ti==Presence.PRESENCE_CHAT || ti==Presence.PRESENCE_OFFLINE) && (c.getGroupType()!=Groups.TYPE_TRANSP) && (c.getGroupType()!=Groups.TYPE_IGNORE)) + playNotify(ti); + }*/ ////////////////////////////////////// + // + /*if (ti==Presence.PRESENCE_OFFLINE) c.acceptComposing=false; c.setComposing(false);*/ } @@ -1452,11 +1612,11 @@ boolean blFlashEn=cf.blFlash; // motorola e398 backlight bug - switch (profile) { - case AlertProfile.ALL: notify=new EventNotify(display, type, message, cf.vibraLen, blFlashEn); break; - case AlertProfile.NONE: notify=new EventNotify(display, null, null, 0, false ); break; - case AlertProfile.VIBRA: notify=new EventNotify(display, null, null, cf.vibraLen, blFlashEn); break; - case AlertProfile.SOUND: notify=new EventNotify(display, type, message, 0, blFlashEn); break; + switch (profile) {// + case AlertProfile.ALL: notify=new EventNotify(display, type, message, volume , cf.vibraLen, blFlashEn); break; + case AlertProfile.NONE: notify=new EventNotify(display, null, null, volume , 0, false ); break; + case AlertProfile.VIBRA: notify=new EventNotify(display, null, null, volume , cf.vibraLen, blFlashEn); break; + case AlertProfile.SOUND: notify=new EventNotify(display, type, message, volume , 0, blFlashEn); break; } if (notify!=null) notify.startNotify(); } @@ -1484,11 +1644,19 @@ //try { //setProgress(SR.MS_LOGINPGS, 42); +//#if NONSASL_ENABLE +//# if (sd.account.isSASL()) { +//#endif new SASLAuth(sd.account, SessionId, this, theStream) - //#if SASL_XGOOGLETOKEN +//#if SASL_XGOOGLETOKEN .setToken(token) - //#endif +//#endif ; +//#if NONSASL_ENABLE +//# } else { +//# new NonSASLAuth(sd.account, SessionId, this, theStream); +//# } +//#endif } /** @@ -1507,7 +1675,7 @@ } else { try { - sendPresence(Presence.PRESENCE_OFFLINE); + sendPresence(Presence.PRESENCE_OFFLINE, "Disconnected due to error"); // } catch (Exception e2) { e2.printStackTrace(); } @@ -1521,16 +1689,16 @@ e.printStackTrace(); try { - sendPresence(Presence.PRESENCE_OFFLINE); + sendPresence(Presence.PRESENCE_OFFLINE, "Disconnected due to error"); // } catch (Exception e2) { } if (e instanceof SecurityException) { errorLog(error); return; } if (e instanceof JabberStreamShutdownException) { errorLog(error); return; } - if (reconnectCount>=maxReconnect) { errorLog(error); return; } + if (reconnectCount>=cf.maxReconnect) { errorLog(error); return; } // //errorLog(error); { reconnectCount++; - String title="("+reconnectCount+"/"+maxReconnect+") Reconnecting"; + String title="("+reconnectCount+"/"+cf.maxReconnect+") Reconnecting"; // Msg m=new Msg(Msg.MESSAGE_TYPE_OUT, "local", title, error); messageStore(selfContact(), m); @@ -1540,7 +1708,7 @@ } private int lastOnlineStatus; public void doReconnect() { - sendPresence(lastOnlineStatus); + sendPresence(lastOnlineStatus, null); // } //private VList l; @@ -1605,6 +1773,14 @@ if (keyCode!=cf.keyLock) userActivity(); } + if (keyCode==KEY_NUM1) { // collapse all groups + for (Enumeration e=groups.elements(); e.hasMoreElements();) { + Group grp=(Group)e.nextElement(); + grp.collapsed=true; + } + reEnumRoster(); + return; + } } private void userActivity() { @@ -1646,11 +1822,32 @@ if (keyCode==KEY_NUM3) new ActiveContacts(display, null); - if (keyCode==cf.keyHide && cf.allowMinimize) { + /*if (keyCode==cf.keyHide && cf.allowMinimize) { Bombus.getInstance().hideApp(true); + }*/ // + + if (keyCode==KEY_NUM9) /*toggleLight();*/ { // + if (cf.allowMinimize) + Bombus.getInstance().hideApp(true); + else if (Version.getPlatformName().startsWith("SIE")) //SIEMENS: MYMENU call. Possible Main Menu for capable phones + try { + Bombus.getInstance().platformRequest("native:ELSE_STR_MYMENU"); + } catch (Exception e) { } + else if (Version.getPlatformName().endsWith("(NSG)")) //SIEMENS-NSG: MYMENU call. Possible Native Menu for capable phones + try { + Bombus.getInstance().platformRequest("native:NAT_MAIN_MENU"); + } catch (Exception e) { } } - if (keyCode==KEY_NUM9) toggleLight(); + if (keyCode==KEY_NUM4) new ConfigForm(display); // + + if (keyCode==KEY_NUM7) new RosterToolsMenu(display); // + + if (!isLoggedIn()) return; // + + if (keyCode==KEY_NUM1) new Bookmarks(display, null); // + + if (keyCode==KEY_NUM6) new PrivacySelect(display); // } public void userKeyPressed(int keyCode){ @@ -1687,7 +1884,7 @@ } - private void toggleLight() { + /*private void toggleLight() { //#ifdef SIEMENS_BACKLIGHT //# if (Version.getPlatformName().endsWith("(NSG)")) { //# if (blState!=1){ @@ -1699,12 +1896,30 @@ //# } //# } //#endif - } + }*/ // +//#if LIGHT_CONTROL +//# public void setLight(boolean state) { +//# if (Version.getPlatformName().startsWith("SIE") || Version.getPlatformName().endsWith("(NSG)")) { +//# try { +//# if (state) { +//# com.siemens.mp.game.Light.setLightOn(); +//# } else { +//# com.siemens.mp.game.Light.setLightOff(); +//# } +//# } catch( Exception e ) { } +//# } +//# if (Version.getPlatformName().startsWith("SonyE") || Version.getPlatformName().startsWith("Nokia")) { +//# LightControl.getInstance().setLight(state); +//# } +//# } +//#endif + public void logoff(){ - if (isLoggedIn()) + if (isLoggedIn() /*&& myStatus!=Presence.PRESENCE_INVISIBLE*/) //kostyl by voffk try { - sendPresence(Presence.PRESENCE_OFFLINE); + ExtendedStatus es=StatusList.getInstance().getStatus(Presence.PRESENCE_OFFLINE); // + sendPresence(Presence.PRESENCE_OFFLINE, es.getMessage()); } catch (Exception e) { e.printStackTrace(); } @@ -1715,6 +1930,11 @@ userActivity(); if (c==cmdQuit) { autostatus.destroyTask(); +//#if LIGHT_CONTROL +//# if (Version.getPlatformName().startsWith("SonyE") || Version.getPlatformName().startsWith("Nokia")) { +//# LightControl.getInstance().destroyTask(); +//# } +//#endif destroyView(); logoff(); //StaticData sd=StaticData.getInstance(); @@ -1768,12 +1988,18 @@ //confGroup.getConference().status=Presence.PRESENCE_ONLINE; } - public void leaveRoom(Group group){ + public void leaveRoom(Group group){//mod: setting Presence.PRESENCE_OFFLINE for all contacts in conferenceGroup!!! //Group group=groups.getGroup(index); ConferenceGroup confGroup=(ConferenceGroup)group; Contact myself=confGroup.getSelfContact(); confGroup.getConference().commonPresence=false; //disable reenter after reconnect - sendPresence(myself.getJid(), "unavailable", null); + // + String myMessage=StatusList.getInstance().getStatus(Presence.PRESENCE_OFFLINE).getMessage(); + myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() ); + myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() ); + JabberDataBlock x=new JabberDataBlock(null, "status", myMessage); + sendPresence(myself.getJid(), "unavailable", x);//// + // //roomOffline(group); } @@ -1899,14 +2125,16 @@ } // self-contact group Group selfContactGroup=groups.getGroup(Groups.TYPE_SELF); - selfContactGroup.visible=(cf.selfContact || selfContactGroup.tonlines>1 || selfContactGroup.unreadMessages>0 ); + //selfContactGroup.visible=(cf.selfContact || selfContactGroup.tonlines>1 || selfContactGroup.unreadMessages>0 ); + selfContactGroup.visible=true; // // hiddens groups.getGroup(Groups.TYPE_IGNORE).visible= cf.ignore ; // transports Group transpGroup=groups.getGroup(Groups.TYPE_TRANSP); - transpGroup.visible= (cf.showTransports || transpGroup.unreadMessages>0); + //transpGroup.visible= (cf.showTransports || transpGroup.unreadMessages>0); + transpGroup.visible=true; // // adding groups for (i=0; i + //setRosterTitle("("+groups.getRosterOnline()+"/"+groups.getRosterContacts()+")"); + setRosterTitle(); + // see also updateTitle() //resetStrCache(); if (cursor<0) cursor=0; @@ -1943,13 +2174,26 @@ if (!isLoggedIn()) return; if (status==Presence.PRESENCE_ONLINE && autoAway) { autoAway=false; - sendPresence(Presence.PRESENCE_ONLINE); + sendPresence(Presence.PRESENCE_ONLINE, null); // return; } - if (status!=Presence.PRESENCE_ONLINE && myStatus==Presence.PRESENCE_ONLINE && !autoAway) { + if (status!=Presence.PRESENCE_ONLINE && (myStatus==Presence.PRESENCE_ONLINE || myStatus==Presence.PRESENCE_CHAT) && !autoAway) {// autoAway=true; - sendPresence(Presence.PRESENCE_AWAY); + sendPresence(Presence.PRESENCE_AWAY, "Auto-away after "+cf.autoAwayDelay+" min."); ///////// } } } + +/*public void setAutoAway() { + if (!autoAway && cf.autoAwayType==cf.AWAY_IDLE) { + oldStatus=myStatus; + autoAway=true; + if (cf.setAutoStatusMessage) { + sendPresence(Presence.PRESENCE_AWAY, SR.MS_AUTO_AWAY); + } else { + sendPresence(Presence.PRESENCE_AWAY, null); + } + } + } +*/ \ No newline at end of file Index: bombus-plus/export/trunk/src/Client/Groups.java =================================================================== --- bombus-plus/export/trunk/src/Client/Groups.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Groups.java (working copy) @@ -27,9 +27,9 @@ package Client; -import com.alsutton.jabber.JabberBlockListener; +/*import com.alsutton.jabber.JabberBlockListener; import com.alsutton.jabber.JabberDataBlock; -import com.alsutton.jabber.datablocks.Iq; +import com.alsutton.jabber.datablocks.Iq;*/ // import images.RosterIcons; import java.util.*; import locale.SR; @@ -40,7 +40,7 @@ * * @author Evg_S */ -public class Groups implements JabberBlockListener{ +public class Groups /*implements JabberBlockListener*/{ // Vector groups; @@ -49,20 +49,20 @@ public final static int TYPE_COMMON=3; public final static int TYPE_IGNORE=4; public final static int TYPE_NOT_IN_LIST=5; - public final static int TYPE_TRANSP=6; - public final static int TYPE_MUC=7; + public final static int TYPE_TRANSP=/*6*/7; // + public final static int TYPE_MUC=/*7*/6; // public final static int TYPE_SEARCH_RESULT=8; public final static String COMMON_GROUP=SR.MS_GENERAL; - private final static String GROUPSTATE_NS="http://bombus-im.org/groups"; + //private final static String GROUPSTATE_NS="http://bombus-im.org/groups"; public Groups(){ groups=new Vector(); addGroup(SR.MS_TRANSPORTS, Groups.TYPE_TRANSP); - addGroup(SR.MS_SELF_CONTACT, Groups.TYPE_SELF); + addGroup(/*SR.MS_SELF_CONTACT */ "self-contacts", Groups.TYPE_SELF); addGroup(SR.MS_SEARCH_RESULTS, Groups.TYPE_SEARCH_RESULT); - addGroup(SR.MS_NOT_IN_LIST, Groups.TYPE_NOT_IN_LIST); + addGroup(/*SR.MS_NOT_IN_LIST */ "Not-in-list", Groups.TYPE_NOT_IN_LIST); addGroup(SR.MS_IGNORE_LIST, Groups.TYPE_IGNORE); addGroup(Groups.COMMON_GROUP, Groups.TYPE_NO_GROUP); } @@ -150,7 +150,7 @@ groups.removeElement(g); } - public int blockArrived(JabberDataBlock data) { + /*public int blockArrived(JabberDataBlock data) { //group state collapsed if (data instanceof Iq) if (data.getTypeAttribute().equals("result")) { JabberDataBlock query=data.findNamespace("query", "jabber:iq:private"); @@ -193,5 +193,5 @@ } //System.out.println(iq.toString()); roster.theStream.send(iq); - } + }*/ } Index: bombus-plus/export/trunk/src/Client/Reconnect.java =================================================================== --- bombus-plus/export/trunk/src/Client/Reconnect.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Reconnect.java (working copy) @@ -44,7 +44,7 @@ private Gauge timer; boolean isRunning; - private final static int WAITTIME=5; + private final static int WAITTIME=10; // /** Creates a new instance of Reconnect */ private Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 2); public Reconnect(String title, String body, Display display) { Index: bombus-plus/export/trunk/src/Client/AccountForm.java =================================================================== --- bombus-plus/export/trunk/src/Client/AccountForm.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/AccountForm.java (working copy) @@ -86,7 +86,7 @@ (account.toString()); f = new Form(title); userbox = new TextField(SR.MS_USERNAME, account.getUserName(), 64, ConstMIDP.TEXTFIELD_URL); - TextFieldCombo.setLowerCaseLatin(userbox); + //TextFieldCombo.setLowerCaseLatin(userbox); // f.append(userbox); passbox = new TextField(SR.MS_PASSWORD, account.getPassword(), 64, TextField.PASSWORD); f.append(passbox); @@ -97,7 +97,11 @@ register = new ChoiceGroup(null, Choice.MULTIPLE); register.append(SR.MS_SSL,null); register.append(SR.MS_PLAIN_PWD,null); - register.append(SR.MS_NO_COMPRESSION,null); +//#if NONSASL_ENABLE +//# register.append(SR.MS_SASL, null); +//#else + register.append(SR.MS_NO_COMPRESSION,null); +//#endif register.append(SR.MS_CONFERENCES_ONLY,null); //#if HTTPCONNECT //# register.append("Proxy connect",null); @@ -105,7 +109,15 @@ //# register.append("HTTP Polling",null); //#endif register.append(SR.MS_REGISTER_ACCOUNT,null); - boolean b[] = {account.getUseSSL(), account.getPlainAuth(), !account.useCompression(), account.isMucOnly(), + boolean b[] = { + account.getUseSSL(), + account.getPlainAuth(), +//#if NONSASL_ENABLE +//# account.isSASL(), +//#else + !account.useCompression(), +//#endif + account.isMucOnly(), //#if HTTPPOLL || HTTPCONNECT //# account.isEnableProxy(), //#endif @@ -197,7 +209,11 @@ account.setNick(nickbox.getString()); account.setUseSSL(b[0]); account.setPlainAuth(b[1]); +//#if NONSASL_ENABLE +//# account.setSasl(b[2]); +//#else account.setUseCompression(!b[2]); +//#endif account.setMucOnly(b[3]); //#if HTTPPOLL || HTTPCONNECT Index: bombus-plus/export/trunk/src/Client/StatusSelect.java =================================================================== --- bombus-plus/export/trunk/src/Client/StatusSelect.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/StatusSelect.java (working copy) @@ -42,10 +42,16 @@ private Command cmdOk=new Command(SR.MS_SELECT,Command.OK,1); private Command cmdEdit=new Command(SR.MS_EDIT,Command.SCREEN,2); + private Command cmdSetDefault=new Command(SR.MS_SETDEFAULT,Command.OK,5); // + private Command cmdReconnect=new Command("Reconnect now!",Command.SCREEN,6); // private Command cmdCancel=new Command(SR.MS_CANCEL,Command.BACK,99); /** Creates a new instance of SelectStatus */ private Vector statusList; private Contact to; + // + private Config cf=Config.getInstance(); + private int defstatus; + // public StatusSelect(Display d, Contact to) { super(); @@ -57,11 +63,16 @@ addCommand(cmdOk); addCommand(cmdEdit); + addCommand(cmdSetDefault); // + addCommand(cmdReconnect); // //addCommand(cmdPriority); //addCommand(cmdAll); addCommand(cmdCancel); setCommandListener(this); - + // + defstatus=Config.getInstance().def_status; + moveCursorTo(defstatus); + // /* int status=StaticData.getInstance().roster.myStatus; int i; @@ -83,6 +94,16 @@ if (c==cmdEdit) { new StatusForm( display, getSel() ); }; + // + if (c==cmdSetDefault) { + cf.def_status=cursor; + cf.saveToStorage(); + redraw(); + } + if (c==cmdReconnect) { + StaticData.getInstance().roster.connectionTerminated(new Exception("reconnecting!!!")); + } + // if (c==cmdCancel) destroyView(); } @@ -126,8 +147,8 @@ f=new Form(status.getScreenName()); - tfMessage=new TextFieldCombo(SR.MS_MESSAGE, status.getMessage(), 100, 0, "status", display); - f.append(tfMessage); + tfMessage=new TextFieldCombo(SR.MS_MESSAGE, status.getMessage(), 200, 0, "status", display); + f.append(tfMessage); // tfPriority=new NumberField(SR.MS_PRIORITY, status.getPriority(), -128, 128); f.append(tfPriority); @@ -172,4 +193,4 @@ public void setParentView(Displayable parentView){ this.parentView=parentView; } -} +} \ No newline at end of file Index: bombus-plus/export/trunk/src/Client/Msg.java =================================================================== --- bombus-plus/export/trunk/src/Client/Msg.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Msg.java (working copy) @@ -107,8 +107,10 @@ return time.toString(); } - public String quoteString(){ - StringBuffer out=new StringBuffer(toString()); + public String quoteString(){ // + StringBuffer out=new StringBuffer(); + out.append((subject==null)?"":""+subject+"\n"); + out.append(toString()); int i=0; while (i + int lastSpace=src.lastIndexOf((byte) ' '); + String date=src.substring(lastSpace+1); + try { + this.dateGmt=Long.parseLong(date); + } catch (java.lang.NumberFormatException e) { + this.dateGmt=Time.dateIso8601(src); + } + } } Index: bombus-plus/export/trunk/src/Client/AlertProfile.java =================================================================== --- bombus-plus/export/trunk/src/Client/AlertProfile.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/AlertProfile.java (working copy) @@ -89,13 +89,13 @@ public String toString(){ StringBuffer s=new StringBuffer(); switch (index) { - case AUTO: s.append(SR.MS_ALERT_PROFILE_AUTO); break; - case ALL: s.append(SR.MS_ALERT_PROFILE_ALLSIGNALS); break; - case VIBRA: s.append(SR.MS_ALERT_PROFILE_VIBRA); break; - case SOUND: s.append(SR.MS_SOUND); break; - case NONE: s.append(SR.MS_ALERT_PROFILE_NOSIGNALS); break; + case AUTO: s.append( "Auto" ); break; + case ALL: s.append( "All signals" ); break; + case VIBRA: s.append( "Vibration" ); break; + case SOUND: s.append( "Sound" ); break; + case NONE: s.append( "No signals" ); break; } - if (index==defp) s.append(SR.MS_IS_DEFAULT); + if (index==defp) s.append( " (default)"); return s.toString(); } } Index: bombus-plus/export/trunk/src/Client/ConfigForm.java =================================================================== --- bombus-plus/export/trunk/src/Client/ConfigForm.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/ConfigForm.java (working copy) @@ -73,19 +73,27 @@ Form f; ChoiceGroup roster; - ChoiceGroup subscr; - - ChoiceGroup nil; + //ChoiceGroup nil; ChoiceGroup message; NumberField MessageLimit; ChoiceGroup startup; ChoiceGroup application; + // +//#if !(ReleaseZLITE) ChoiceGroup lang; +//#endif +//#if ARCHIVE_ADVANCED + ChoiceGroup archive; + boolean arch[]; +//#endif ChoiceGroup sndFile; - //Gauge sndVol; + Gauge sndVol; + NumberField maxreconnect; + // + ChoiceGroup font1; ChoiceGroup font2; @@ -115,7 +123,9 @@ boolean ap[]; boolean su[]; Vector files[]; +//#if !(ReleaseZLITE) Vector langs[]; +//#endif /** Creates a new instance of ConfigForm */ public ConfigForm(Display display) { @@ -127,37 +137,37 @@ f=new Form(SR.MS_OPTIONS); roster=new ChoiceGroup(SR.MS_ROSTER_ELEMENTS, Choice.MULTIPLE); roster.append(SR.MS_OFFLINE_CONTACTS, null); - roster.append(SR.MS_SELF_CONTACT, null); - roster.append(SR.MS_TRANSPORTS, null); + /*roster.append(SR.MS_SELF_CONTACT, null); + roster.append(SR.MS_TRANSPORTS, null); */ // roster.append(SR.MS_IGNORE_LIST, null); - //roster.append(SR.MS_NOT_IN_LIST, null); +//#if !ReleaseZVOFFK + roster.append("Not-in-list presences", null); +//#endif roster.append(SR.MS_AUTOFOCUS,null); + roster.append(SR.MS_AUTH_NEW,null); + roster.append(SR.MS_LAST_APPEARED_CONTACTS, null); boolean ra[]={ cf.showOfflineContacts, - cf.selfContact, - cf.showTransports, + /*cf.selfContact, + cf.showTransports, */ // cf.ignore, - //cf.notInList, - cf.autoFocus +//#if !ReleaseZVOFFK + cf.notInListPresences, +//#endif + cf.autoFocus, + cf.autoSubscribe, + cf.lastAppearedContacts // }; this.ra=ra; //ra[5]=false; roster.setSelectedFlags(ra); - - subscr=new ChoiceGroup(SR.MS_AUTH_NEW, Choice.POPUP); - subscr.append(SR.MS_SUBSCR_AUTO, null); - subscr.append(SR.MS_SUBSCR_ASK, null); - subscr.append(SR.MS_SUBSCR_DROP, null); - subscr.append(SR.MS_SUBSCR_REJECT, null); - subscr.setSelectedIndex(cf.autoSubscribe, true); - - - nil=new ChoiceGroup(SR.MS_NOT_IN_LIST, ConstMIDP.CHOICE_POPUP); + + /*nil=new ChoiceGroup(SR.MS_NOT_IN_LIST, ConstMIDP.CHOICE_POPUP); nil.append(SR.MS_NIL_DROP_MP, null); nil.append(SR.MS_NIL_DROP_P, null); nil.append(SR.MS_NIL_ALLOW_ALL, null); - nil.setSelectedIndex((cf.notInListDropLevel>NotInListFilter.ALLOW_ALL)? NotInListFilter.ALLOW_ALL: cf.notInListDropLevel, true); + nil.setSelectedIndex((cf.notInListDropLevel>NotInListFilter.ALLOW_ALL)? NotInListFilter.ALLOW_ALL: cf.notInListDropLevel, true); */ // message=new ChoiceGroup(SR.MS_MESSAGES, Choice.MULTIPLE); message.append(SR.MS_SMILES, null); @@ -196,25 +206,34 @@ su[0]=cf.autoLogin; su[1]=cf.autoJoinConferences; startup.setSelectedFlags(su); - - ap=new boolean[5]; + + ap=new boolean[6]; int apctr=0; application=new ChoiceGroup(SR.MS_APPLICATION, Choice.MULTIPLE); -//#if !(MIDP1) + application.append(SR.MS_FULLSCREEN,null); ap[apctr++]=cf.fullscreen; - application.append(SR.MS_FULLSCREEN,null); -//#endif - application.append(SR.MS_HEAP_MONITOR,null); + /*application.append(SR.MS_HEAP_MONITOR,null); + ap[apctr++]=cf.memMonitor;*/ // application.append(SR.MS_SHOW_HARDWARE,null); - if (!cf.ghostMotor) + ap[apctr++]=cf.enableVersionOs; + if (!cf.ghostMotor) { + ap[apctr++]=cf.blFlash; application.append(SR.MS_FLASHBACKLIGHT,null); - if (cf.allowMinimize) + } +//#if LIGHT_CONTROL +//# ap[apctr++]=cf.lightState; +//# application.append("turn on light (SIE, SE & Nokia)", null); +//#endif + if (cf.allowMinimize) { + ap[apctr++]=cf.popupFromMinimized; application.append(SR.MS_ENABLE_POPUP,null); - ap[apctr++]=cf.memMonitor; - ap[apctr++]=cf.enableVersionOs; - ap[apctr++]=cf.blFlash; - ap[apctr++]=cf.popupFromMinimized; - + } +//#if TRAFFIC +//# // +//# ap[apctr++]=cf.showTraffic; +//# application.append("show traffic",null); +//#endif + application.setSelectedFlags(ap); autoAwayType=new ChoiceGroup(SR.MS_AWAY_TYPE, ConstMIDP.CHOICE_POPUP); @@ -230,8 +249,21 @@ fieldLoc=new NumberField(SR.MS_CLOCK_OFFSET, cf.locOffset, -12, 12 ); sndFile=new ChoiceGroup(SR.MS_SOUND, ConstMIDP.CHOICE_POPUP); - files=new StringLoader().stringLoader("/sounds/res.txt",3); + + // + sndVol=new Gauge(SR.MS_SOUND_VOLUME, true, 10, cf.soundVol/10); +//#if ARCHIVE_ADVANCED + archive=new ChoiceGroup(SR.MS_ARCHIVE, Choice.MULTIPLE); + archive.append("Export to cp1251", null); + arch=new boolean[1]; + arch[0]=cf.cp1251; + archive.setSelectedFlags(arch); +//#endif + maxreconnect=new NumberField(SR.MS_MAX_RECONNECT, cf.maxReconnect, 0, 30); + // + files=new StringLoader().stringLoader("/sounds/res.txt",3); + for (Enumeration f=files[2].elements(); f.hasMoreElements(); ) { sndFile.append( (String)f.nextElement(), null ); } @@ -257,28 +289,36 @@ font1.setSelectedIndex(cf.font1/8, true); font2.setSelectedIndex(cf.font2/8, true); +//#if COLOR_THEMES + f.append(themeFile); +//#endif + f.append(sndFile); // + f.append(sndVol); // + f.append(roster); - f.append(subscr); - f.append(nil); + //f.append(nil); f.append(font1); + f.append(font2); // f.append(message); f.append(MessageLimit); - f.append(font2); + //f.append(font2); String textWraps[]={SR.MS_TEXTWRAP_CHARACTER, SR.MS_TEXTWRAP_WORD}; textWrap=new ChoiceGroup(SR.MS_TEXTWRAP, ConstMIDP.CHOICE_POPUP, textWraps,null); textWrap.setSelectedIndex(cf.textWrap, true); f.append(textWrap); - f.append(sndFile); - -//#if COLOR_THEMES - f.append(themeFile); -//#endif + // + //f.append(sndFile); + +///#if COLOR_THEMES +// f.append(themeFile); +///#endif +//#if !(ReleaseZLITE) lang=new ChoiceGroup("Language", ConstMIDP.CHOICE_POPUP); - langs=new StringLoader().stringLoader("/lang/res.txt",3); + langs=new StringLoader().stringLoader("/lang/res.txt",3); for (int i=0; i +//#if ARCHIVE_ADVANCED + f.append(archive); // //#endif - f.append(startup); f.append(application); - + + f.append(maxreconnect); // + f.append(autoAwayType); f.append(fieldAwatDelay); //f.append(keepAlive); - f.append(SR.MS_TIME_SETTINGS); - f.append("\n"); + /*f.append(SR.MS_TIME_SETTINGS); + f.append("\n");*/ f.append(fieldGmt); f.append(fieldLoc); +//#if !(ReleaseZLITE) f.append(lang); +//#endif f.addCommand(cmdOk); f.addCommand(cmdCancel); @@ -331,17 +376,20 @@ message.getSelectedFlags(mv); application.getSelectedFlags(ap); startup.getSelectedFlags(su); - - cf.notInListDropLevel=nil.getSelectedIndex(); - cf.showOfflineContacts=ra[0]; - cf.selfContact=ra[1]; - cf.showTransports=ra[2]; - cf.ignore=ra[3]; - //cf.notInList=ra[4]; - cf.autoFocus=ra[4]; - cf.autoSubscribe=subscr.getSelectedIndex(); - + //cf.notInListDropLevel=nil.getSelectedIndex(); + int raIdx=0; + cf.showOfflineContacts=ra[raIdx++]; + /*cf.selfContact=ra[1]; + cf.showTransports=ra[2];*/ // + cf.ignore=ra[raIdx++]; +//#if !ReleaseZVOFFK + cf.notInListPresences=ra[raIdx++]; +//#endif + cf.autoFocus=ra[raIdx++]; + cf.autoSubscribe=ra[raIdx++]; + cf.lastAppearedContacts=ra[raIdx++]; // + cf.smiles=mv[0]; int haIdx=1; //#if (HISTORY) @@ -360,14 +408,20 @@ cf.autoJoinConferences=su[1]; int apctr=0; -//#if !(MIDP1) VirtualList.fullscreen=cf.fullscreen=ap[apctr++]; StaticData.getInstance().roster.setFullScreenMode(cf.fullscreen); + //VirtualList.memMonitor=cf.memMonitor=ap[apctr++]; + cf.enableVersionOs=ap[apctr++]; + if (!cf.ghostMotor) + cf.blFlash=ap[apctr++]; +//#if LIGHT_CONTROL +//# cf.lightState=ap[apctr++]; //#endif - VirtualList.memMonitor=cf.memMonitor=ap[apctr++]; - cf.enableVersionOs=ap[apctr++]; - cf.blFlash=ap[apctr++]; - cf.popupFromMinimized=ap[apctr++]; + if (cf.allowMinimize) + cf.popupFromMinimized=ap[apctr++]; +//#if TRAFFIC +//# cf.showTraffic=ap[apctr++]; // +//#endif cf.gmtOffset=fieldGmt.getValue(); cf.locOffset=fieldLoc.getValue(); @@ -386,16 +440,28 @@ cf.textWrap=textWrap.getSelectedIndex(); - //cf.soundVol=sndVol.getValue()*10; - cf.lang=(String) langs[0].elementAt( lang.getSelectedIndex() ); - + // + cf.soundVol=sndVol.getValue()*10; +//#if ARCHIVE_ADVANCED + archive.getSelectedFlags(arch); + cf.cp1251=arch[0]; +//#endif + cf.maxReconnect=maxreconnect.getValue(); +//#if !(ReleaseZLITE) + cf.lang=(String) langs[0].elementAt( lang.getSelectedIndex() ); +//#else +//# cf.lang="ru"; +//#endif + // cf.autoAwayDelay=fieldAwatDelay.getValue(); cf.autoAwayType=autoAwayType.getSelectedIndex(); cf.loadSoundName(); cf.messageCollapsedLength=MessageLimit.getValue(); - +//#if LIGHT_CONTROL +//# StaticData.getInstance().roster.setLight(cf.lightState); +//#endif cf.updateTime(); cf.saveToStorage(); @@ -431,7 +497,10 @@ int sound=sndFile.getSelectedIndex(); String soundFile=(String)files[1].elementAt(sound); String soundType=(String)files[0].elementAt(sound); - new EventNotify(display, soundType, soundFile, 0, false).startNotify(); + // + int soundVol=sndVol.getValue()*10; + new EventNotify(display, soundType, soundFile, soundVol, 0, false).startNotify(); + // } } Index: bombus-plus/export/trunk/src/Client/SubscriptionEdit.java =================================================================== --- bombus-plus/export/trunk/src/Client/SubscriptionEdit.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/SubscriptionEdit.java (working copy) @@ -40,6 +40,7 @@ Command cmdAskSubscr=new Command(SR.MS_ASK_SUBSCRIPTION, Command.SCREEN, 1); Command cmdGrantSubscr=new Command(SR.MS_GRANT_SUBSCRIPTION, Command.SCREEN, 2); Command cmdSubscrDel=new Command(SR.MS_SUBSCR_REMOVE, Command.SCREEN, 3); + Command cmdDenyPresences=new Command(SR.MS_UNSUBSCRIBE_FROM_PRESENCES, Command.SCREEN, 4); // //Command cmdUnsubscr=new Command(SR.MS_UNSUBSCRIBE, Command.SCREEN); Command cmdBack=new Command(SR.MS_CANCEL, Command.BACK, 99); @@ -64,6 +65,7 @@ addCommand(cmdGrantSubscr); addCommand(cmdAskSubscr); addCommand(cmdSubscrDel); + addCommand(cmdDenyPresences); // addCommand(cmdBack); setCommandListener(this); @@ -76,6 +78,7 @@ if (c==cmdAskSubscr) { presence="subscribe"; } if (c==cmdGrantSubscr) { presence="subscribed"; } if (c==cmdSubscrDel) { presence="unsubscribed"; } + if (c==cmdDenyPresences) { presence="unsubscribe"; } // if (presence!=null) r.sendPresence(to,presence, null); Index: bombus-plus/export/trunk/src/Client/Contact.java =================================================================== --- bombus-plus/export/trunk/src/Client/Contact.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Contact.java (working copy) @@ -94,6 +94,7 @@ private int newMsgCnt=-1; public int unreadType; public int lastUnread; + ///public int breakPoint;///save cursor pos - voffk public VCard vcard; @@ -144,6 +145,9 @@ default: return RosterIcons.ICON_MESSAGE_INDEX; } if (incomingComposing!=null) return RosterIcons.ICON_COMPOSING_INDEX; + + if (incomingState>0) return incomingState; // + int st=(status==Presence.PRESENCE_OFFLINE)?offline_type:status; if (st<8) st+=transport; return st; @@ -353,4 +357,38 @@ if (m.id.equals(id)) m.delivered=true; } } + + // + public final void smartPurge(int cursor) { + try { + if (cursor==msgs.size() && msgs.size()>0) + msgs=new Vector(); + else + for (int i=0; i } Index: bombus-plus/export/trunk/src/Client/Group.java =================================================================== --- bombus-plus/export/trunk/src/Client/Group.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Group.java (working copy) @@ -26,6 +26,7 @@ */ package Client; +import Conference.MucContact; // import com.alsutton.jabber.datablocks.Presence; import images.RosterIcons; import java.util.*; @@ -44,6 +45,7 @@ protected int nContacts; protected int onlines; public int imageExpandedIndex=RosterIcons.ICON_EXPANDED_INDEX; + public int imageCollapsedIndex=RosterIcons.ICON_COLLAPSED_INDEX; // public Vector contacts; @@ -63,7 +65,7 @@ public int getColor(){ return Colors.GROUP_INK; } public int getImageIndex() { return collapsed? - RosterIcons.ICON_COLLAPSED_INDEX + /*RosterIcons.ICON_COLLAPSED_INDEX*/imageCollapsedIndex // :imageExpandedIndex; } @@ -101,10 +103,10 @@ || type==Groups.TYPE_NOT_IN_LIST || type==Groups.TYPE_TRANSP || c.origin==Contact.ORIGIN_GROUPCHAT + || c instanceof MucContact // ) contacts.addElement(c); } - void finishCount() { //contacts=tcontacts; onlines=tonlines; Index: bombus-plus/export/trunk/src/Client/ContactMessageList.java =================================================================== --- bombus-plus/export/trunk/src/Client/ContactMessageList.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/ContactMessageList.java (working copy) @@ -81,13 +81,14 @@ addCommand(cmdActive); addCommand(cmdQuote); addCommand(cmdArch); - if (contact instanceof MucContact && contact.origin==Contact.ORIGIN_GROUPCHAT) { addCommand(cmdReply); } setCommandListener(this); moveCursorTo(contact.firstUnread()); + ///moveCursorTo(contact.breakPoint+1,true);///save cursor pos - voffk //setRotator(); + contact.setIncoming(Contact.INC_NONE); // } public void showNotify(){ @@ -140,6 +141,7 @@ public void focusedItem(int index){ markRead(index); + ///setBreakPoint(index);///save cursor pos - voffk /*try { Msg msg=(Msg) contact.msgs.elementAt(index); if (msg.messageType==Msg.MESSAGE_TYPE_AUTH) addCommand(cmdSubscribe); @@ -157,7 +159,8 @@ } catch (Exception e) {/*no messages*/} } if (c==cmdPurge) { - clearMessageList(); + //clearMessageList(); + clearReadedMessageList(); } /** login-critical section */ @@ -169,28 +172,30 @@ } if (c==cmdResume) { keyGreen(); } if (c==cmdQuote) { - try { - String msg=new StringBuffer() - .append((char)0xbb) // » - .append(getMessage(cursor).quoteString()) - .append("\n") - .toString(); - new MessageEdit(display,contact,msg); - } catch (Exception e) {/*no messages*/} + Quote(); + //try { + // String msg=new StringBuffer() + // .append((char)0xbb) // » + // .append(getMessage(cursor).quoteString()) + // .append("\n") + // .toString(); + //new MessageEdit(display,contact,msg); + //} catch (Exception e) {/*no messages*/} } if (c==cmdReply) { - try { - if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return; - if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return; + Reply(); + //try { + //if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return; + //if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return; - Msg msg=getMessage(cursor); - /*String body=msg.toString(); - int nickLen=body.indexOf(">"); - if (nickLen<0) nickLen=body.indexOf(" "); - if (nickLen<0) return;*/ + //Msg msg=getMessage(cursor); + // /*String body=msg.toString(); + //int nickLen=body.indexOf(">"); + //if (nickLen<0) nickLen=body.indexOf(" "); + //if (nickLen<0) return;*/ - new MessageEdit(display,contact,msg.from+": "); - } catch (Exception e) {/*no messages*/} + //new MessageEdit(display,contact,msg.from+": "); + //} catch (Exception e) {/*no messages*/} } if (c==cmdContact) { new RosterItemActions(display, contact, -1); @@ -209,15 +214,24 @@ } } - - private void clearMessageList() { + // + /*private void clearMessageList() { //TODO: fix scrollbar size moveCursorHome(); contact.purge(); messages=new Vector(); System.gc(); redraw(); + }*/ + private void clearReadedMessageList() { + contact.smartPurge(cursor+1); + messages=new Vector(); + ///contact.breakPoint=0;///save cursor pos - voffk + contact.lastUnread=getItemCount()-1; + moveCursorHome(); + redraw(); } + // public void keyGreen(){ if (!sd.roster.isLoggedIn()) return; @@ -225,18 +239,74 @@ contact.msgSuspended=null; } - public void keyRepeated(int keyCode) { + // + /*public void keyRepeated(int keyCode) { if (keyCode==KEY_NUM3) new ActiveContacts(display, contact); else super.keyRepeated(keyCode); - } - + }*/ + public void userKeyPressed(int keyCode) { super.userKeyPressed(keyCode); - if (keyCode==keyClear) { - if (messages.isEmpty()) return; - new YesNoAlert(display, SR.MS_CLEAR_LIST, SR.MS_SURE_CLEAR, this); + if (keyCode==KEY_NUM3) new ActiveContacts(display, contact); + if (keyCode==keyClear || keyCode=='0') new YesNoAlert(display, SR.MS_CLEAR_LIST, SR.MS_SURE_CLEAR, this); + if (keyCode=='#') { //reply + if (contact instanceof MucContact && contact.origin==Contact.ORIGIN_GROUPCHAT) { + Reply(); + } else { + keyGreen(); + } } + if (keyCode==KEY_NUM9) { //quote + Quote(); + } } + + public void ActionConfirmed() { /*clearMessageList();*/ clearReadedMessageList(); } + + private void Reply() { // + try { + if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return; + if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return; + Msg msg=getMessage(cursor); + new MessageEdit(display, contact, msg.from+": "); + } catch (Exception e) {/*no messages*/} + } + + private void Quote() { // + /*try { //without kostyl + StringBuffer msg=new StringBuffer(); + .append(getMessage(cursor).quoteString()) + .append("\n// ") + .toString(); + new MessageEdit(display, contact, msg); + msg=null; + } catch (Exception e) { } + }*/ + try { // + StringBuffer msg=new StringBuffer(); + if (getMessage(cursor).messageType != Msg.MESSAGE_TYPE_SUBJ) { + msg.append(getMessage(cursor).quoteString()); + msg.append("\n// "); + } else { + msg.append(quoteMucSubject(getMessage(cursor).quoteString())); + } + new MessageEdit(display, contact, msg.toString()); + msg=null; + } catch (Exception e) {/*no messages*/} + } + + private static String quoteMucSubject(String text) { // + String result=text; + if (result!=null && result.length()>0) {//?????????? + int startpos=result.indexOf(": ", 0); + if (startpos!=-1) { + result=result.substring(startpos+2); + }; + } + return result; + } - public void ActionConfirmed() { clearMessageList(); } -} + ///private void setBreakPoint(int index) {///save cursor pos - voffk + ///contact.breakPoint=index; + ///} +} \ No newline at end of file Index: bombus-plus/export/trunk/src/Client/AccountSelect.java =================================================================== --- bombus-plus/export/trunk/src/Client/AccountSelect.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/AccountSelect.java (working copy) @@ -1,5 +1,5 @@ /* - * AccountPicker.java + * AccountSelect.java * * Created on 19.03.2005, 23:26 * @@ -27,7 +27,7 @@ */ package Client; -import images.RosterIcons; +//import images.RosterIcons; import io.NvStorage; import locale.SR; import midlet.Bombus; @@ -44,7 +44,7 @@ */ public class AccountSelect extends VirtualList - implements CommandListener{ + implements CommandListener, YesNoAlert.YesNoListener /*voffk*/{ Vector accountList; int activeAccount; @@ -57,7 +57,7 @@ Command cmdCancel=new Command(SR.MS_BACK,Command.BACK,99); Command cmdQuit=new Command(SR.MS_APP_QUIT,Command.SCREEN,10); - /** Creates a new instance of AccountPicker */ + /** Creates a new instance of AccountSelect */ public AccountSelect(Display display, boolean enableQuit) { super(); //this.display=display; @@ -75,16 +75,17 @@ accountList.addElement(a); a.active=(activeAccount==index); index++; - } - } while (a!=null); - if (accountList.isEmpty()) { + } + } while (a!=null); + + /*if (accountList.isEmpty()) { a=Account.createFromJad(); if (a!=null) { - //a.updateJidCache(); accountList.addElement(a); rmsUpdate(); } - } + }*/ // + attachDisplay(display); addCommand(cmdAdd); @@ -130,17 +131,13 @@ if (c==cmdAdd) { new AccountForm(this, display, null); } - if (c==cmdDel) { + if (c==cmdDel) { // { Config cf=Config.getInstance(); if (cf.accountIndex>cursor) cf.accountIndex--; cf.saveToStorage(); } - accountList.removeElement(getFocusedObject()); - rmsUpdate(); - moveCursorHome(); - commandState(); - redraw(); + new YesNoAlert(display, SR.MS_DELETE, "Are you sure want to delete this account?", this); } } @@ -163,4 +160,11 @@ NvStorage.writeFileRecord(outputStream, Account.storage, 0, true); } + public void ActionConfirmed() { // + accountList.removeElement(getFocusedObject()); + rmsUpdate(); + moveCursorHome(); + commandState(); + redraw(); + } } Index: bombus-plus/export/trunk/src/Client/Account.java =================================================================== --- bombus-plus/export/trunk/src/Client/Account.java (revision 1288) +++ bombus-plus/export/trunk/src/Client/Account.java (working copy) @@ -58,7 +58,11 @@ private int port=5222; public boolean active; private boolean useSSL; +//#if NONSASL_ENABLE +//# private boolean sasl=true; +//#else private boolean compression; +//#endif private boolean plainAuth; private boolean mucOnly; @@ -69,9 +73,11 @@ private String proxyHostAddr; private int proxyPort; - public int keepAlivePeriod=200; + public int keepAlivePeriod=400; // public int keepAliveType=1; + public int defstatus; // + //private String jid; /** Creates a new instance of Account */ @@ -85,12 +91,14 @@ if (a!=null) { sd.roster.logoff(); sd.roster.resetRoster(); - if (launch) sd.roster.sendPresence(Presence.PRESENCE_ONLINE); + //if (launch) sd.roster.sendPresence(Presence.PRESENCE_ONLINE); + if (launch) + sd.roster.sendPresence(Config.getInstance().def_status, null); //????? } return a; } - public static Account createFromJad(){ + /*public static Account createFromJad(){ Account a=new Account(); MIDlet m=Bombus.getInstance(); try { @@ -101,7 +109,7 @@ } catch (Exception e) { } if (a.server==null) return null; return a; - } + }*/ // public static Account createFromDataInputStream(DataInputStream inputStream){ @@ -132,7 +140,11 @@ } if (version>=6) +//#if NONSASL_ENABLE +//# a.sasl=inputStream.readBoolean(); +//#else a.compression=inputStream.readBoolean(); +//#endif if (version>=7) { a.keepAliveType=inputStream.readInt(); @@ -207,9 +219,11 @@ outputStream.writeBoolean(enableProxy); outputStream.writeUTF(proxyHostAddr); outputStream.writeInt(proxyPort); - +//#if NONSASL_ENABLE +//# outputStream.writeBoolean(sasl); +//#else outputStream.writeBoolean(compression); - +//#endif outputStream.writeInt(keepAliveType); outputStream.writeInt(keepAlivePeriod); @@ -277,7 +291,13 @@ //# proxy="socket://" + getProxyHostAddr() + ':' + getProxyPort(); //#endif } - return new JabberStream( getServer(), url.toString(), true, proxy); + return new JabberStream( getServer(), url.toString(), +//#if NONSASL_ENABLE +//# sasl, +//#else + true, +//#endif + proxy); } public boolean isEnableProxy() { @@ -304,14 +324,24 @@ this.proxyPort = proxyPort; } +//#if NONSASL_ENABLE +//# public boolean isSASL() { return sasl; } +//# public void setSasl(boolean sasl) { this.sasl = sasl; } +//#else public boolean useCompression() { return compression; } public void setUseCompression(boolean value) { this.compression = value; } - +//#endif + public boolean useGoogleToken() { if (useSSL) return false; /*if (hostAddr==null) return false; if (hostAddr.indexOf("google")<0) return false; */ +//#if NONSASL_ENABLE +//# if (!server.startsWith("gmail.com")) return false; +//# return isSASL(); +//#else return (server.startsWith("gmail.com")); +//#endif } } Index: bombus-plus/export/trunk/build.xml =================================================================== --- bombus-plus/export/trunk/build.xml (revision 1288) +++ bombus-plus/export/trunk/build.xml (working copy) @@ -15,26 +15,54 @@ + + + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + @@ -86,13 +114,21 @@ + + + + + @@ -138,6 +178,9 @@ + Index: bombus-plus/export/trunk/setenv.bat =================================================================== --- bombus-plus/export/trunk/setenv.bat (revision 1288) +++ bombus-plus/export/trunk/setenv.bat (working copy) @@ -1,3 +1,2 @@ -set JAVA_HOME=D:\DEV\java\jdk -rem set NB_ANT=D:\DEV\java\netbeans-5.0rc2\ide6\ant\bin\ant.bat -set NB_ANT=D:\DEV\java\netbeans-5.5\ide7\ant\bin\ant.bat \ No newline at end of file +set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_02 +set NB_ANT=C:\Program Files\netbeans-5.5.1\ide7\ant\bin\ant.bat \ No newline at end of file Index: bombus-plus/export/trunk/resources/version.properties =================================================================== --- bombus-plus/export/trunk/resources/version.properties (revision 1288) +++ bombus-plus/export/trunk/resources/version.properties (working copy) @@ -1,4 +1,5 @@ # version pattern bombus.revision=$WCREV$-RC1 -bombus.version=0.6.$WCREV$-RC1 +bombus.version=0.6.1288.$WCREV$-RC1 bombus.midlet=0.6 +# bombus.builddate=$BUILDDATE$ Index: bombus-plus/export/trunk/resources/text/lang/ru.txt =================================================================== --- bombus-plus/export/trunk/resources/text/lang/ru.txt (revision 1288) +++ bombus-plus/export/trunk/resources/text/lang/ru.txt (working copy) @@ -1,20 +1,10 @@ -// Russian langfile for Bombus - mobile jabber client -// Copyright (c) 2005-2007, Eugene Stahov (evgs), http://bombus-im.org. All rights reserved. -// (c) Alexey V.Lubimov , 2006. -// (c) Vladimir N. Shelukhin , 2006-2007. -// (c) Vladimir A. Kichigin , 2007-2008. - -// ask server to send us localized messages +//ru.txt for bombus-plus by voffk xmlLang ru - -//463 Jid Jid Privacy Lists Списки приватности Message font Шрифт сообщения Roster font Шрифт ростера -Paste Body Встав. тело сообщения Configure Room Конфигуратор комнаты -Paste Subject Встав. тему сообщения Service Discovery Обзор сервисов User JID JID пользователя New list Новый список @@ -24,8 +14,8 @@ Modify Изменить Update Обновить Account name Имя аккаунта -GMT offset Часовой пояс (GMT+) -Time settings (hours) Настройки времени +GMT offset, ±hours Часовой пояс, ±час. (GMT±xx) +Clock offset, ±hours Дополнит. смещ. времени, ±час. Connected Соединение установлено Connect to Соединение с Alert Profile Сигналы @@ -92,7 +82,6 @@ Nicknames Вставить ник to Archive В архив Back Назад -heap monitor монитор heap Message Сообщение <Другой> Append Добавить @@ -114,14 +103,14 @@ Contact > Контакт > offline contacts показать отключенных Transport Транспорт -composing events извещения о наборе текста -Add Smile Встав. смайлик +composing events сигналы о наборе текста +Add Smile Смайлы Nickname Ник Revoke Voice Отнять право голоса Commands Команды - (Sign) - (знак) Set default Уст. по умолчанию -Outcasts (Ban) Изгои (Ban) +Outcasts (Ban) Бан Set affiliation to Изменить членство на Register Account Зарегистрировать аккаунт autologin автосоединение @@ -136,7 +125,6 @@ Cancel Отмена Close Закрыть Archive Архив -free свободно Conference Конференция Sound Звук Login failed Ошибка авторизации @@ -159,7 +147,6 @@ for all status types для всех статусов Paste Jid Вставить Jid Goto URL Перейти к URL -Clock offset Смещение часов flash backlight мигать подсветкой Suspend Отложить Resume Message Черновик @@ -167,13 +154,9 @@ My vCard Личная vCard transports транспорты New Account Новый аккаунт -self-contact свои контакты -vCard vCard Set Subject Установить тему Tools Инструменты Port Порт - -//473 Connect Подключиться history - история - Are You sure want to discard Вы действительно собираетесь понизить у @@ -182,17 +165,13 @@ // DO NOT TRANSLATE THIS LINES!!! Ignore-List Ignore-List -Not-in-list Not-in-list +General General Stanzas Stanzas -//476 -Clear Очистить -//494 +Clear Очистить Ask subscription Запросить подписку Grant subscription Разрешить подписку - -//502 Invite to conference Пригласить в конференцию Reason Причина You have been invited to Вы были приглашены в @@ -204,23 +183,19 @@ Grant Admin Дать право администратора Grant Ownership Дать право владельца room presences статусы в конференции - is now known as сменил ник на was banned запретили входить в данную конференцию was kicked выгнали из конференции has been kicked because room became members-only выгнан, т.к. конференция теперь только для членов - has left the channel вышел из конференции - has joined the channel as подключился как + has left the room вышел из конференции + has joined the room as подключился как and и is now теперь - Participants Участники Abc Абв - -//1063 autofocus автофокус Grant Membership Дать членство -Are You sure want to clear messagelist? Вы уверены, что хотите очистить список сообщений? +Delete the messages above the cursor? Удалить сообщения выше курсора? Google token request Запрос рукопожатия у Google SASL login SASL-логин Features Возможности @@ -238,8 +213,7 @@ Info Инфо Reply Ответить Send status Установить статус -Are you sure want to BAN this person? Вы уверены, что хотите запретить вход данному пользователю? -No reason Без причины +Are you sure want to BAN this person? Вы уверены, что хотите забанить данного пользователя? Recent История ввода Shot Снять Select file Выбрать файл @@ -248,32 +222,21 @@ Camera Камера Hide finished Скрыть завершённые Transfer tasks Менеджер передачи файлов -Are you sure want to delete this message? Вы уверены, что хотите удалить данное сообщение? +Are you sure want to delete this message? Удалить данное сообщение? New conference Новая конференция Root Корень диска Decline Отклонить -Authorize new contacts Автоматическая авторизация +authorize new contacts автоматич. авторизация [auto-subscribe] [автоподписка] Keep-Alive Тип Keep-Alive has been unaffiliated and kicked from members-only room был лишён полномочий и выгнан, т.к. конференция только для членов -Minutes before away Таймер автостатуса (минуты) +Minutes before away Таймер автостатуса, мин Automatic Away Автосмена статуса disabled выключено keyblock / flip блок / флип idle бездействие Add autojoin bookmark Добав. закладку с автовходом -//2007-04-12 -//role роль -//affiliation полномочия -//visitor гость -//participant участник -//moderator модератор -//owner владелец -//admin администратор -//member член конференции - -//2007-08-19 online доступен free for chat готов поболтать away отсутствует @@ -281,23 +244,14 @@ invisible невидим do not disturb не беспокоить offline отключен -Join marked (auto) Подключиться к отмеченным для автовхода +Join marked (auto) Подкл. к отмеч. для автовхода shared platform info показывать модель устройства delivery events отчёты о доставке -drop all не принимать ничего -receive messages принимать сообщения -messages & presences сообщения и присутствия normal обычный small мелкий large крупный File Transfers Передача файлов -Auto Автоматически -All signals Все сигналы -Vibra Вибрация -No signals Без сигналов - (default) (по умолчанию) -//2007-10-24 voffk Message collapse limit Сворачивать сообщения больше This user wants to subscribe to your presence Запрос подписки на присутствие You are now authorized Вы получили подписку @@ -313,19 +267,23 @@ Save to Сохранить как Sender: Отправитель: size: размер: - -//2007-11-07 zet -Automatic subscription автоподписка -Ask me спросить меня -Drop subscription отклонять -Deny subscription запрещать -Search Поиск -Register Регистрация Color theme Цветовая тема -Memory: Память: -Free= Свободно= -Total= Всего= Versions Версии Install Установить Available versions Доступные версии -User Пользователь \ No newline at end of file +User Пользователь +no compression без сжатия траффика +New room created Создана новая комната + +//voffk +Paste Вставить +Paste + ~~~~~~~ Вставить c ~~~~~~~ +Unsubscribe from presences Отписаться от статусов +last appeared contacts недавно появившиеся контакты +Save photo to ... Сохранить фото в ... +Time Время +Idle Бездействие +Sound volume Громкость звука +Reconnects count Попытки реконнекта +Save to dir ... Сохранить в папку ... +Import from file Загрузить из файла Index: bombus-plus/export/trunk/resources/text/lang/res.txt =================================================================== --- bombus-plus/export/trunk/resources/text/lang/res.txt (revision 1288) +++ bombus-plus/export/trunk/resources/text/lang/res.txt (working copy) @@ -1,8 +1,2 @@ en null English ru /lang/ru.txt Russian -pl /lang/pl.txt Polish -cz /lang/cz.txt Czech -sk /lang/sk.txt Slovak -uk /lang/uk.txt Ukrainian -bg /lang/bg.txt Bulgarian -id /lang/id.txt Indonesian Index: bombus-plus/export/trunk/resources/text/def_bookmarks.txt =================================================================== --- bombus-plus/export/trunk/resources/text/def_bookmarks.txt (revision 1288) +++ bombus-plus/export/trunk/resources/text/def_bookmarks.txt (working copy) @@ -1,2 +1,3 @@ +bombus-plus@conference.jabbus.org bombus-talks@conference.jabber.ru bombus@conference.jabber.ru Index: bombus-plus/export/trunk/resources/themes/themes/res.txt =================================================================== --- bombus-plus/export/trunk/resources/themes/themes/res.txt (revision 1288) +++ bombus-plus/export/trunk/resources/themes/themes/res.txt (working copy) @@ -1,7 +1,8 @@ null default /themes/tkabber.txt Tkabber /themes/opera.txt Opera -/themes/summer.txt Summer -/themes/newyear.txt NewYear -/themes/night.txt Night -/themes/water.txt Water \ No newline at end of file +/themes/black.txt Black +/themes/bombusmod.txt BombusMod +/themes/emo.txt Emo +/themes/halloween.txt Halloween +/themes/walkman.txt Walkman Index: bombus-plus/export/trunk/resources/themes/themes/tkabber.txt =================================================================== --- bombus-plus/export/trunk/resources/themes/themes/tkabber.txt (revision 1288) +++ bombus-plus/export/trunk/resources/themes/themes/tkabber.txt (working copy) @@ -20,13 +20,12 @@ MESSAGE_IN 0x000000 MESSAGE_OUT 0xa90909 MESSAGE_PRESENCE 0x000000 +//with _S must be updated +MESSAGE_IN_S 0x000000 +MESSAGE_OUT_S 0xa90909 +MESSAGE_PRESENCE_S 0x000000 MESSAGE_AUTH 0x000000 MESSAGE_HISTORY 0x000000 -CURSOR_BGND 0x8c8c8c -CURSOR_OUTLINE 0x000000 -SCROLL_BRD 0x565656 -SCROLL_BAR 0x929292 -SCROLL_BGND 0x727272 PGS_REMAINED 0xd0d1d1 PGS_COMPLETE 0x7d7d7d PGS_BORDER 0x000000 @@ -34,7 +33,8 @@ HEAP_TOTAL 0xdadada //voffk HEAP_FREE 0x000000 -//with _S must be updated -MESSAGE_IN_S 0x000000 -MESSAGE_OUT_S 0xa90909 -MESSAGE_PRESENCE_S 0x000000 \ No newline at end of file +CURSOR_BGND 0x8c8c8c +CURSOR_OUTLINE 0x000000 +SCROLL_BRD 0x565656 +SCROLL_BAR 0x929292 +SCROLL_BGND 0x727272 \ No newline at end of file Index: bombus-plus/export/trunk/resources/MIDP2/images/smiles.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bombus-plus/export/trunk/resources/MIDP2/images/mrim.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bombus-plus/export/trunk/resources/MIDP2/images/skin.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt =================================================================== --- bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt (revision 1288) +++ bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt (working copy) @@ -1,31 +1,31 @@ -:-) :) -;-) ;) -:-P :-p :P :p -:-D :-d :D :d :-> :> :lol: :LOL: *LOL* *lol* :)) -:-( :( ;-( ;( :(( +:) :-) +;) ;-) +:-P :-p :P :p +:-D :-d :D :d :-> :> :lol: :LOL: *LOL* *lol* :)) :))) +:( :-( ;-( ;( :(( :'( :'-( 8( -:-O :-o :O :o =-O :-0 8-O -:-@ :@ >:o -:-$ :$ *KISSED* :") :-[ *SORRY* *sorry* +:-O :-o :O :o =-O :-0 8-O +%) %-) *CRAZY* *crazy* *ROFL* rofl +:-$ :$ *KISSED* :") :-[ *SORRY* *sorry* *PARDON* :-| :| -:-S :-s :S :s -B-) (H) (h) 8-) -(Y) (y) *THUMBS UP* *THUMBS_UP* -(N) (n) *THUMBS DOWN* *THUMBS_DOWN* *STOP* -(6) ]:-> -(B) (b) *DRINK* :drink: *BEER* -(%) +:-S :-s :S :s +8-) B-) (H) (h) +(Y) (y) *YES *THUMBS UP* *THUMBS_UP* +(N) (n) *NO* *THUMBS DOWN* *THUMBS_DOWN* +:-* :* =* *KISSING* +@}->-- @};- @}->- (f) (F) *BOUQUET* +*DRINK* (B) (b) *BEER* (D) (d) ->:) >:-) >:D >:-D -:-B +:O) :o) *JOKINGLY* :0) :-] +:-B *BOTAN* :-? :? *dntknw* *DONT_KNOW* *-:) 8-X 8-x @= *horror* -:O) :o) *JOKINGLY* :0) :-] +:-\ :-/ :/ :\ :-& :-X :-x :-! :! *SUP* -|-) |) *TIRED* +|-) |) *TIRED* 3-|{ (C) ~o) ~O) :-" -:-* :* =* *KISSING* -@}->-- @};- @}->- (f) (F) *BOUQUET* -:-\ :-/ :/ :\ +(6) ]:-> +>:) >:-) >:D >:-D +:-@ :@ >:o Index: bombus-plus/export/trunk/resources/MIDP2/images/splash.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bombus-plus/export/trunk/resources/MIDP2/images/transports.txt =================================================================== --- bombus-plus/export/trunk/resources/MIDP2/images/transports.txt (revision 1288) +++ bombus-plus/export/trunk/resources/MIDP2/images/transports.txt (working copy) @@ -1,8 +1,13 @@ +muc#vis /images/visitors.png +aol /images/aim.png aim /images/aim.png +msn /images/msn.png +yahoo /images/yahoo.png icq /images/icq.png +icq2 /images/icq.png jit /images/icq.png -msn /images/msn.png mrim /images/mrim.png rss /images/rss.png -yahoo /images/yahoo.png -muc#vis /images/visitors.png \ No newline at end of file +news /images/rss.png +j2j /images/j2j.png +j3j /images/j2j.png \ No newline at end of file Index: bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt =================================================================== --- bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt (revision 1288) +++ bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt (working copy) @@ -1,7 +1,9 @@ //type path desc -audio/amr /sounds/message.amr message.amr -audio/x-wav /sounds/message.wav message.wav -audio/midi /sounds/message.mid message.mid -//audio/mp3 /sounds/message.mp3 message.mp3 -audio/x-tone-seq /sounds/mary.seq mary.seq +audio/mp3 /sounds/ow-vinni-pooh.mp3 ow-vinni-pooh.mp3 +audio/amr /sounds/person.amr person.amr +audio/midi /sounds/000.mid 000.mid +audio/midi /sounds/chat.mid chat.mid +audio/midi /sounds/online.mid online.mid +//audio/x-wav /sounds/message.wav message.wav +//audio/x-tone-seq /sounds/mary.seq mary.seq tone tone sequence