void insertOrUpdateChat(String message){
  ContentValues values=new ContentValues(2);
  values.put(Imps.Chats.LAST_MESSAGE_DATE,System.currentTimeMillis());
  values.put(Imps.Chats.LAST_UNREAD_MESSAGE,message);
  values.put(Imps.Chats.GROUP_CHAT,mIsGroupChat);
  mContentResolver.insert(mChatURI,values);
}

void insertOrUpdateChat ( String message ) { ContentValues values = new ContentValues ( 2 ) ; values . put ( Imps . Chats . LAST_MESSAGE_DATE , System . currentTimeMillis ( ) ) ; values . put ( Imps . Chats . LAST_UNREAD_MESSAGE , message ) ; values . put ( Imps . Chats . GROUP_CHAT , mIsGroupChat ) ; mContentResolver . insert ( mChatURI , values ) ; }
private void copyhistorymessages ( contact oldparticipant ) { list < org . awesomeapp . messenger . model . message > historymessages = mchatsession . gethistorymessages ( ) ; int total = historymessages . size ( ) ; int start = total > max_history_copy_count ? total - max_history_copy_count : 0 ; for ( int i = start ; i < total ; i + + ) { org . awesomeapp . messenger . model . message msg = historymessages . get ( i ) ; boolean incoming = msg . getfrom ( ) . equals ( oldparticipant . getaddress ( ) ) ; string contact = incoming ? oldparticipant . getname ( ) : null ; long time = msg . getdatetime ( ) . gettime ( ) ; insertmessageindb ( contact , msg . getbody ( ) , time , incoming ? imps . messagetype . incoming : imps . messagetype . outgoing ) ; } }
