Skip to content
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
2 changes: 1 addition & 1 deletion TelegramBot/TelegramBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function telegram_message_bug_added( $p_type_event, $p_issue, $p_issue_id ) {
telegram_message_generic( $p_issue_id, 'new', 'telegram_message_notification_title_for_action_bug_submitted' );
}

function telegram_message_bugnote_add( $p_type_event, $p_bug_id, $p_bugnote_id ) {
function telegram_message_bugnote_add( $p_type_event, $p_bug_id, $p_bugnote_id, $files ) {
global $g_skip_sending_bugnote;

if( $g_skip_sending_bugnote == TRUE ) {
Expand Down
4 changes: 3 additions & 1 deletion TelegramBot/core/TelegramBot_helper_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ function telegram_add_comment( $p_current_action, $p_message, $p_reply_to_messag
// 'reply_markup' => keyboard_bug_status_change_is( $t_bug_id )
];
} catch( Mantis\Exceptions\MantisException $t_error ) {
$t_file_is_deleted = unlink( $t_file_path );
if( isset( $t_file_path ) ) {
$t_file_is_deleted = unlink( $t_file_path );
}

$t_params = $t_error->getParams();
if( !empty( $t_params ) ) {
Expand Down
8 changes: 6 additions & 2 deletions TelegramBot/core/TelegramBot_message_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,11 @@ function bug_get_id_from_message_id( $p_chat_id, $p_msg_id ) {
$t_result = db_query( $t_query, array( $p_chat_id, $p_msg_id ) );

$t_row = db_fetch_array( $t_result );
$t_bug_id = $t_row['bug_id'];

if( $t_row === false ) {
$t_bug_id = 0;
} else {
$t_bug_id = $t_row['bug_id'];
}

return (int) $t_bug_id;
}
12 changes: 10 additions & 2 deletions TelegramBot/core/TelegramBot_user_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function user_get_id_by_telegram_user_id( $p_telegram_user_id ) {
$t_result = db_query( $t_query, array( $p_telegram_user_id ) );

$t_row = db_fetch_array( $t_result );
$t_user_id = $t_row['mantis_user_id'];
if( $t_row === false ) {
$t_user_id = 0;
} else {
$t_user_id = $t_row['mantis_user_id'];
}

return (int) $t_user_id;
}
Expand All @@ -106,7 +110,11 @@ function telegram_user_get_id_by_user_id( $p_mantis_user_id ) {
$t_result = db_query( $t_query, array( $p_mantis_user_id ) );

$t_row = db_fetch_array( $t_result );
$t_user_id = $t_row['telegram_user_id'];
if( $t_row === false ) {
$t_user_id = 0;
} else {
$t_user_id = $t_row['telegram_user_id'];
}

return (int) $t_user_id;
}
Expand Down