Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #57

Merged
merged 8 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions src/main/java/com/zoffcc/applications/sorm/GroupMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class GroupMessage
public String group_identifier = "-1"; // f_key -> GroupDB.group_identifier

@Column(indexed = true, helpers = Column.Helpers.ALL)
public String tox_group_peer_pubkey;
public String tox_group_peer_pubkey; // uppercase

@Column(indexed = true, helpers = Column.Helpers.ALL)
@Nullable
Expand Down Expand Up @@ -89,7 +89,7 @@ public class GroupMessage

@Column(indexed = true, helpers = Column.Helpers.ALL)
@Nullable
public String msg_id_hash = null; // 32byte hash
public String msg_id_hash = null; // 32byte hash (as hex string uppercase)

@Column(indexed = true, helpers = Column.Helpers.ALL)
@Nullable
Expand Down Expand Up @@ -158,8 +158,12 @@ public List<GroupMessage> toList()
try
{
Statement statement = sqldb.createStatement();
ResultSet rs = statement.executeQuery(
this.sql_start + " " + this.sql_where + " " + this.sql_orderby + " " + this.sql_limit);
final String sql = this.sql_start + " " + this.sql_where + " " + this.sql_orderby + " " + this.sql_limit;
if (ORMA_TRACE)
{
Log.i(TAG, "sql=" + sql);
}
ResultSet rs = statement.executeQuery(sql);
while (rs.next())
{
GroupMessage out = new GroupMessage();
Expand Down Expand Up @@ -485,4 +489,27 @@ public GroupMessage orderBySent_timestampAsc()
this.sql_orderby = this.sql_orderby + " sent_timestamp ASC ";
return this;
}

public GroupMessage private_messageEq(int private_message) {
this.sql_where = this.sql_where + " and private_message='" + s(private_message) + "' ";
return this;
}

public GroupMessage orderByRcvd_timestampAsc() {
if (this.sql_orderby.equals(""))
{
this.sql_orderby = " order by ";
}
else
{
this.sql_orderby = this.sql_orderby + " , ";
}
this.sql_orderby = this.sql_orderby + " rcvd_timestamp ASC ";
return this;
}

public GroupMessage msg_id_hashEq(String msg_id_hash) {
this.sql_where = this.sql_where + " and msg_id_hash='" + s(msg_id_hash) + "' ";
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void move_tmp_file_to_real_file(String src_path_name, String src_file_nam

public static String get_incoming_filetransfer_local_filename(String incoming_filename, String friend_pubkey_str)
{
Log.i(TAG, "get_incoming_filetransfer_local_filename:000:" + incoming_filename);
String result = filter_out_specials_from_filepath(incoming_filename);
String wanted_full_filename_path = VFS_FILE_DIR + "/" + friend_pubkey_str;
Log.i(TAG, "get_incoming_filetransfer_local_filename:start=" + incoming_filename + " " + result + " " +
Expand Down
Loading
Loading