# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/20phone
# 電話番号
-# $Id: 20phone,v 1.9 2009-07-12 02:54:22 ishikawa Exp $
+# $Id: 20phone,v 1.10 2009-07-15 12:29:51 ishikawa Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/20phone,v $
# The line number (1 incremented) and filename below must be
message_replace_regexp => '\b(0\d{1,3})([-(]?)(\d{2,4})([-)]?)(\d{4})\b',
message_replace_imprementation => sub {
my ($request, $session_id, $p1, $p2, $p3, $p4, $p5) = @_;
- sprintf('<a target="_self" class="inline" href="%s%s/phone/%s%s%s">%s%s%s%s%s</a>',
- $::cf->web_root(),
- $session_id,
- $p1, $p3, $p5,
- $p1, $p2, $p3, $p4, $p5);
+ my $ci = new Keitairc::ClientInfo($request);
+ if ($ci->is_ipod()) {
+ # iPhone では ダイレクトに phone to にして、
+ # アプリ側処理に任せる
+ sprintf('<a target="_self" class="inline" href="tel:%s%s%s">%s%s%s%s%s</a>',
+ $p1, $p3, $p5,
+ $p1, $p2, $p3, $p4, $p5);
+ } else {
+ sprintf('<a target="_self" class="inline" href="%s%s/phone/%s%s%s">%s%s%s%s%s</a>',
+ $::cf->web_root(),
+ $session_id,
+ $p1, $p3, $p5,
+ $p1, $p2, $p3, $p4, $p5);
+ }
},
action_imprementation => sub {