You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixed_num = num.split(separator:",").joined(separator:"\" or chat_identifier is \"")
324
+
fixed_num =[String](repeating:"?", count:num.split(separator:",").count).joined(separator:" or chat_identifier is ")
325
325
}
326
326
327
327
if from !=0{
328
-
from_string =" and \(is_group ?"m.":"")is_from_me is \(from ==1?1:0)"
328
+
from_string =" and m.is_from_me is \(from ==1?1:0)"
329
329
}
330
-
331
-
varmessages:[[String:Any]]=selectFromSql(db: db, columns:["m.ROWID","m.guid","m.text","m.subject","m.is_from_me","m.date","m.service","m.cache_has_attachments","m.balloon_bundle_id","m.payload_data","m.associated_message_guid","m.associated_message_type","h.id"], table:"message m", condition:"left join handle h on h.ROWID = m.handle_id where m.ROWID in (select message_id from chat_message_join where chat_id in (select ROWID from chat where chat_identifier is ?\(from_string))) order by m.date desc", args:[fixed_num], num_items: num_items, offset: offset, split_ids:true)
330
+
331
+
varmessages:[[String:Any]]=selectFromSql(db: db, columns:["m.ROWID","m.guid","m.text","m.subject","m.is_from_me","m.date","m.service","m.cache_has_attachments","m.balloon_bundle_id","m.payload_data","m.associated_message_guid","m.associated_message_type","h.id"], table:"message m", condition:"left join handle h on h.ROWID = m.handle_id where m.ROWID in (select message_id from chat_message_join where chat_id in (select ROWID from chat where chat_identifier is \(fixed_num)\(from_string))) order by m.date desc", args:num.split(separator:",").map({String($0)}), num_items: num_items, offset: offset, split_ids:true)
Copy file name to clipboardExpand all lines: src/SMServer/shared/ServerDelegate.swift
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,8 @@ class ServerDelegate {
62
62
/// This is kinda a hacky way sending the notification into a `CFNotificationCallback`, which then posts a notification in the `NSNotificationCenter`), but
63
63
/// it is necessary. The `CFNotificationCallback` can't capture context, but the `NSNotificationCenter` callback can. We need to capture context for our purposes,
64
64
/// so this seemed like the most efficient solution to accomplish that.
65
+
66
+
/// However, it does post the notification like 10 times in 5 seconds, so that's why we have to have the special checks in the `reloadServer(_:)` function
0 commit comments