Skip to content

Commit

Permalink
Apply workaround for compatibility with telegram-cli test branch (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdstaaij committed Mar 3, 2016
1 parent e144d5a commit 877b276
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion formatters/pisg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def end_dialog(dialog)
path = File.join(@dialog_dir, 'usermap.cfg')
File.open(path, 'w:UTF-8') do |stream|
user_names.each do |user_id, name|
stream.puts('<user nick="%s" alias="u%d">' % [name, user_id])
stream.puts('<user nick="%s" alias="u%s">' % [name, user_id.to_s])
end
end

Expand Down
5 changes: 5 additions & 0 deletions telegram-history-dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ def save_progress
dialogs.each do |dialog|
next if dialog['print_name'].nil?
next if dialog['print_name'].empty?

# Compatibility with upcoming tg version (1.4)
dialog['id'] = dialog['peer_id'] if dialog.key?('peer_id')
dialog['type'] = dialog['peer_type'] if dialog.key?('peer_type')

if backup_target?(dialog)
backup_list.push(dialog)
else
Expand Down

0 comments on commit 877b276

Please sign in to comment.