summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/msglib/msglib_sq3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/msglib/msglib_sq3.c b/src/msglib/msglib_sq3.c
index 50c45ad..1f47040 100755
--- a/src/msglib/msglib_sq3.c
+++ b/src/msglib/msglib_sq3.c
@@ -516,6 +516,7 @@ int sq3_new_message_count(struct msg_base_t *mb, struct user_record *user) {
}
if (sqlite3_prepare_v2(dbase, sql, strlen(sql), &res, NULL) != SQLITE_OK) {
sqlite3_close(dbase);
+ dolog("SQL PREPARE Failed");
return 0;
}
sqlite3_bind_int(res, 1, last_read);
@@ -524,7 +525,7 @@ int sq3_new_message_count(struct msg_base_t *mb, struct user_record *user) {
const char *from = sqlite3_column_text(res, 0);
const char *oaddress = sqlite3_column_text(res, 2);
const char *daddress = sqlite3_column_text(res, 3);
- if (sqlite3_column_int(res, 4) | SQ3_MSG_PRIVATE) {
+ if (sqlite3_column_int(res, 4) & SQ3_MSG_PRIVATE) {
if (!(!msg_is_to(user, to, daddress, mb->mc->nettype, mb->mc->realnames, mb->mc) &&
!msg_is_from(user, from, oaddress, mb->mc->nettype, mb->mc->realnames, mb->mc) &&
!msg_is_to(user, to, daddress, mb->mc->nettype, !mb->mc->realnames, mb->mc) &&